Skip to main content

Class Client


Class Client

Declared in packages/sdk/client/src/client/client.ts:60open 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

reloadedopen in new window

Type: Event<void>

Emitted after the client is reset and the services have finished restarting.

versionopen in new window

Type: "0.6.3"

The version of this client API.

configopen in new window

Type: Config

Current configuration object.

graphopen in new window

Type: Hypergraph

haloopen in new window

Type: Halo

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.

shellopen in new window

Type: Shell

spacesopen in new window

Type: Echo

statusopen in new window

Type: MulticastObservable<"null" | SystemStatus>

Client services system status.

Methods

[custom]()open in new window

Returns: string

Arguments: none

addTypes(types)open in new window

Add schema types to the client.

Returns: Client

Arguments:

types: Schema<any, any, never>[]

destroy()open in new window

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

Returns: Promise<void>

Arguments: none

diagnostics(options)open in new window

Get client diagnostics data.

Returns: Promise<any>

Arguments:

options: JsonKeyOptions

initialize()open in new window

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

Returns: Promise<void>

Arguments: none

repair()open in new window

Test and repair database.

Returns: Promise<any>

Arguments: none

reset()open in new window

Resets and destroys client storage.

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