Skip to content
This repository has been archived by the owner. It is now read-only.

Authentication Types

luizguicl edited this page May 22, 2017 · 5 revisions

BLiP Chat Web supports three different user authentication types. It is possible to define which authentication method BLiP Chat Web will use to identify your client.

  • Guest - Users will receive a guest account to interact with the chatbot. In this mode the users have not message history.
  • Login - Users will receive an account with his 'Name' and 'Email' (provided by the user) to interact with the chatbot. In this mode the users have not message history.
  • Dev - Users will receive an account identified by developer to interact with the chatbot. User data must be provided using the user parameter on options object. The user parameter has four properties: identifier, password, name and email. Identifier and Password are required. In this mode the users have message history.

To define what user authetication type use the authType parameter on options object. Possible values for authType are: 'Guest', 'Login' and 'Dev'. You must access them using 'BlipWebSDK.AuthType' class.

Note: 'Guest' type will be used as default If you do not define 'authType'.

Example

authType as 'Guest'

var options = {
    config: {
        authType: BlipWebSDK.AuthType.GUEST
    }
};

new BlipWebSDK.ChatBuilder()
  .withApiKey('PUT-YOUR-API-KEY-HERE')
  .build(options);

authType as 'Login'

var options = {
    config: {
        authType: BlipWebSDK.AuthType.LOGIN
    }
};

new BlipWebSDK.ChatBuilder()
  .withApiKey('PUT-YOUR-API-KEY-HERE')
  .build(options);

authType as 'Dev'

var options = {
    config: {
        authType: BlipWebSDK.AuthType.DEV,
        // This parameter should be used only on DEV auth type
        user: { 
            id: 'USER-IDENTIFIER', // Required
            password: 'USER-PASSWORD', // Required
            name: 'USER-NAME', // Optional
            email: 'USER-EMAIL' // Optional
        }
    }
};

new BlipWebSDK.ChatBuilder()
  .withApiKey('PUT-YOUR-API-KEY-HERE')
  .build(options);
Clone this wiki locally
You can’t perform that action at this time.