Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • User

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Readonly password

password: Password

Readonly profile

profile: Profile

Private Readonly store

store: Store

Methods

impersonate

  • Get an access token for any user using the server's API key and secret. Even if the API client was not initialized with a user access token, performing this action will internally set the token if the login is successful.

    const client = new OutsetaApiClient({ subdomain: 'test-company', apiKey: 'api_key', secretKey: 'api_secret' });
    const response = await client.user.impersonate('username');
    console.log(response.access_token);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • username: string

      (usually an email address)

    Returns Promise<LoginResponse>

    The response body with the user's JWT token.

login

  • login(username: string, password: string): Promise<LoginResponse>
  • Get an access token for a user via their username and password. Even if the API client was not initialized with a user access token, performing this action will internally set the token if the login is successful.

    const client = new OutsetaApiClient({ subdomain: 'test-company' });
    const response = await client.user.login('username', 'password');
    console.log(response.access_token);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • username: string

      (usually an email address)

    • password: string

    Returns Promise<LoginResponse>

    The response body with the user's JWT token.

Generated using TypeDoc