Class Client

About 1 min

Class Client

Declared in packages/sdk/client/src/packlets/client/client.ts:51open in new window

The Client class encapsulates the core client-side API of DXOS.

Constructors

constructor(options)open in new window

Returns: Client

Arguments:

options: ClientOptions

Properties

versionopen in new window

Type: "0.1.45"

The version of this client API

configopen in new window

Type: Config

Current configuration object

dbRouteropen in new window

Type: DatabaseRouter

haloopen in new window

Type: HaloProxy

HALO credentials.

initializedopen in new window

Type: boolean

Returns true if the client has been initialized. Initialize by calling .initialize()

meshopen in new window

Type: MeshProxy

MESH networking.

servicesopen in new window

Type: ClientServicesProvider

Current client services provider.

spacesopen in new window

Type: MulticastObservable<Space[]>

ECHO spaces.

statusopen in new window

Type: MulticastObservable<"null" | SystemStatus>

Client services system status.

Methods

[custom]()open in new window

Returns: string

Arguments: none

acceptInvitation(invitation)open in new window

Accept an invitation to a space.

Returns: AuthenticatingInvitationObservable

Arguments:

invitation: Invitation

addSchema(schema)open in new window

Returns: void

Arguments:

schema: EchoSchema

createSerializer()open in new window

Returns: SpaceSerializer

Arguments: none

createSpace([meta])open in new window

Creates a new space.

Returns: Promise<Space>

Arguments:

meta: PropertiesProps

destroy()open in new window

Cleanup, release resources. Open/close is re-entrant.

Returns: Promise<void>

Arguments: none

getSpace(spaceKey)open in new window

Get an existing space by its key.

Returns: undefined | Space

Arguments:

spaceKey: PublicKey

initialize()open in new window

Initializes internal resources in an idempotent way. Required before using the Client instance.

Returns: Promise<void>

Arguments: none

reset()open in new window

Resets and destroys client storage. Warning: Inconsistent state after reset, do not continue to use this client instance.

Returns: Promise<void>

Arguments: none

resumeHostServices()open in new window

Reinitialized the client session with the remote service host. This is useful when connecting to a host running behind a resource lock (e.g., HALO when SharedWorker is unavailable).

Returns: Promise<void>

Arguments: none

toJSON()open in new window

Returns: object

Arguments: none