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.profile;
})();
Â
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.createProfile();
})();
Â
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.createProfile({
displayName: 'Alice'
});
})();
Â
Before data can be manipulated, a space
must be obtained.