Skip to main content

Class: Api

Client for the DriftDB Room API. This is used to create new rooms and get information about existing rooms.

Constructors

constructor

new Api(apiUrl)

Create a new DriftDB Room API client.

Parameters

NameTypeDescription
apiUrlstringThe base URL of the DriftDB Room API.

Defined in

js-pkg/packages/driftdb/src/api.ts:32

Properties

apiUrl

apiUrl: string

Defined in

js-pkg/packages/driftdb/src/api.ts:25

Methods

getRoom

getRoom(roomId): Promise<RoomResult>

Get information about an existing room.

Parameters

NameTypeDescription
roomIdstringThe ID of the room to get information about.

Returns

Promise<RoomResult>

The room information.

Defined in

js-pkg/packages/driftdb/src/api.ts:58


newRoom

newRoom(): Promise<RoomResult>

Ask the DriftDB server to create a new room and return its information.

Returns

Promise<RoomResult>

The room information.

Defined in

js-pkg/packages/driftdb/src/api.ts:44