get-authentication-token

A function that gets the authentication token of the currently logged-in user.

Installation#

npm install @iqmetrix/get-authentication-token

Interface#

const getAuthenticationToken: () => Promise<string>

Example#

import getAuthenticationToken from '@iqmetrix/get-authentication-token';
getAuthenticationToken()
.then(console.log)
.catch(console.error)

See tests for more examples.

The function rejects to an error with the name "MissingAuthenticationTokenError" if it's unable to read a token from the Hub shell.

Sources#

Last updated on by aslaug sollilja