Namespace: auth

auth

Methods

auth.authenticate (opts) static

Manually specify jwt and namespace
Name Type Description
opts object Options
Name Type Description
token string The JWT
namespace string The namespace, e.g "/companies/company_id"

auth.getCompanies ()array asyncstatic

Gets the authenticated users companies. Calling this method before authenticating will throw an error.
Returns:
Type Description
array An array of companies

auth.getUserinfo ()json asyncstatic

Gets info about the authenticated user. Calling this method before authenticating will throw an error.
Returns:
Type Description
json The raw API response for userinfo

auth.login (opts) asyncstatic

Authenticate with Verified email and password
Name Type Description
opts object Options
Name Type Description
email string Your Verified email
password string Your Verified password

auth.setNamespace (companyID) static

Sets the namespace of the auth instance
Name Type Description
companyID string The namespace to set. E.g "/companies/company_id"

auth.setToken (token) static

Sets the JWT of the auth instance
Name Type Description
token string The JWT

auth.useTokenFromUrl () static

Sets the JWT from one of the two URL parameters "verified_token" or "access_token" (required) Sets the namespace from one of the two URL parameters "c" or "namespace" (optional)