Skip to main content

Identity

Less than 1 minute

Identity

This section describes how to obtain HALO identity in TypeScript.

To create or join a space in ECHO, the user must first establish a HALO identity.

Obtaining identity

import { Client } from '@dxos/client';

const client = new Client();

(async () => {
  await client.initialize();
  const identity = client.halo.identity.get();
})();






 

The object returned is of type Identity.

Creating an identity

Create a new identity:

import { Client } from '@dxos/client';

const client = new Client();

(async () => {
  await client.initialize();
  const identity = await client.halo.createIdentity();
})();






 

Creating an identity with a display name

Pass displayName to createProfile:

import { Client } from '@dxos/client';

const client = new Client();

(async () => {
  await client.initialize();
  const identity = await client.halo.createIdentity({
    displayName: 'Alice'
  });
})();







 


Before data can be manipulated, a space must be obtained.