Configuration

The simple steps for including the ĀLO Chat SDK into your application.

Get Your API Key

If you do not already have an API key please see Developer Account.

Install

yarn add @aloai/alo-chat-js
// or
npm install @aloai/alo-chat-js --save

Import

import Chat from '@aloai/alo-chat-js';

Initialize Chat Client

import Chat from '@aloai/alo-chat-js';

const chat = new Chat({
    authToken: "USER_AUTH_TOKEN_GOES_HERE", // required
    userId: "b98e7c91-b869-4f57-9e2a-b90cb85f8f0e", // required
    deviceId: "x4f57" // optional
});

Props

Name

Type

Required

Description

authToken

string

yes

The token generated by the ALO auth service. This is what allows the client access to the channels and messages specified when the authToken was created. See Generating User Authentication Tokens.

userId

string

yes

The unique identifier of the user represented as the author of the messages sent by this client. The userId must match the userId that was specified when the authToken was created.

deviceId

string

no

The unique identifier of the device scoped to a userId. If left blank the SDK will use a random uuid instead.

Last updated