client.authenticate()

This method allows you to sign in using an apikey and apisecret.

Important: Do not use the key and secret generated for you to login to the web console. Logging out with the JS SDK will invalidate the key and secret pair. This method should only be used with dynamically generated keys and secrets granted to an administrator.

Partners should generally prefer to use the client.signIn() method instead, unless there is a need to pass in previously-obtained authentcation information.

Definition

client.authenticate(
key: string,
secret: string
):Promise<Session,Error>

Parameters

ParameterTypeDescription
keystringThe user's API key
secretstringThe user's API secret

Returns

An error will be thrown if any of the arguments are invalid.

Otherwise, once the returned Promise is resolved, we will have access to a partial User with some fields missing.

Example

const user = await client.authenticate('c96049e39f883e2', '2ee8bff8cb41');
console.log('Signed in as', user.displayName);