Class Client

About 1 min

Class Client

Declared in packages/sdk/client/dist/types/src/packlets/client/client.d.ts:29

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

Constructors

constructor([options])

Returns: Client

Arguments:

options: ClientOptions

Properties

version

Type: "0.1.36"

The version of this client API

config

Type: Config

Current configuration object

dbRouter

Type: DatabaseRouter

halo

Type: HaloProxy

HALO credentials.

initialized

Type: boolean

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

mesh

Type: MeshProxy

MESH networking.

services

Type: ClientServicesProvider

Current client services provider.

spaces

Type: MulticastObservable<Space[]>

ECHO spaces.

status

Type: MulticastObservable<"null" | SystemStatus>

Client services system status.

Methods

[custom]()

Returns: string

Arguments: none

acceptInvitation(invitation)

Accept an invitation to a space.

Returns: AuthenticatingInvitationObservable

Arguments:

invitation: Invitation

addSchema(schema)

Returns: void

Arguments:

schema: EchoSchema

createSerializer()

Returns: SpaceSerializer

Arguments: none

createSpace([meta])

Creates a new space.

Returns: Promise<Space>

Arguments:

meta: PropertiesProps

destroy()

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

Returns: Promise<void>

Arguments: none

getSpace(spaceKey)

Get an existing space by its key.

Returns: undefined | Space

Arguments:

spaceKey: PublicKey

initialize()

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

Returns: Promise<void>

Arguments: none

reset()

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

Returns: Promise<void>

Arguments: none

resumeHostServices()

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()

Returns: object

Arguments: none