Skip to main content
@smokeballdev/smokeball-client-sdk

Interface: Api

Entry point for auth to Smokeball.

Methods

connect()

connect(request): Promise<TokenSession>
Establishes a new token session that can be used to generate fresh OAuth tokens.

Parameters

request
ConnectRequest

Returns

Promise<TokenSession> a token session.

Example

const request: ConnectRequest = {
 jwt
};
const session = await sdk.auth.connect(request);
const token = await session.accessToken();

idToken()

idToken(): Promise<string>

Returns

Promise<string> the current id token.

Deprecated

Use connect() instead. Retrieves the id token. This token can be used to access the api. Only available to trusted clients.

Example

const token = await sdk.auth.idToken();

token()

token(): Promise<string>

Returns

Promise<string> the current access token.

Deprecated

Use connect() instead. Retrieves the access token. Only available to trusted clients.

Example

const token = await sdk.auth.token();