Skip to content

Authentication Types

Luiz Guilherme edited this page Oct 1, 2020 · 2 revisions

BLiP Chat Widget supports two different user authentication types. It's possible to define which authentication method BLiP Chat will use to identify your clients.

  • GUEST (default) - Users will receive a guest account to interact with the chatbot. A guest account expire after 30 days. In this mode the users have not message history.
  • DEV_AUTH - Users will receive an account identified by the developer to interact with the chatbot. Any user is identified by two parameters userIdentity and userPassword. In order to update any other information about the user use the withAccount method (you can use any property defined here ). In this mode the users have message history.

To define DEV_AUTH user authentication type use the withAuth method on builder object.

Note: 'GUEST' type will be used as default If you do not use the 'withAuth' method.

Examples

authType as 'GUEST' (default)

import { BlipChat } from "blip-chat-widget";
new BlipChat()
  .withAppKey("YOUR-APP-KEY")
  .withButton({ color: "#2CC3D5" })
  .build();

authType as 'DEV_AUTH'

var builder = new BlipChat()
  .withAppKey("YOUR-APP-KEY")
  .withButton({ color: "#2CC3D5" })
  .withAuth({
       authType: BlipChat.DEV_AUTH,
       userIdentity: '1234567',
       userPassword: 'MTIzNDU2',
  })
  .withAccount({
       fullName: 'John Doe',
       email:'johndoe@gmail.com',
       phoneNumber: '+15055034455',
       city: 'Decatur',
  });
builder.build()
Clone this wiki locally