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

Interface: Api

Entry point for auth to Smokeball.

Methods

connect()

connect(request): Promise<OAuthTokenResponse>
Generates fresh OAuth tokens for the current session. Uses the client id passed in the SDK init request to generate the OAuth tokens.

Parameters

request
ConnectRequest

Returns

Promise<OAuthTokenResponse> the current OAuth token response.

Example

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

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