Skip to main content

setToken

setToken(tokenSecret): Promise<boolean>

Set the token for the CausaDB client. This is required to authenticate with the CausaDB API.

Parameters

NameTypeDescription
tokenSecretstringToken secret provided by CausaDB.

Returns

Promise<boolean>

True if the token is valid, False otherwise.

Throws

If the token is invalid.

Example

const client = new CausaDB();
const valid = await client.setToken('test-token-secret');