🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@festkit/embeddable-chat

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@festkit/embeddable-chat

## Installation

npmnpm
Version
1.0.0
Version published
Weekly downloads
18
Maintainers
2
Weekly downloads
 
Created
Source

Festkit Embeddable Chat

Usage Screenshot

Installation

Embeddable Chat is available as an NPM package.

To install:

yarn add @festkit/embeddable-chat

or

npm install @festkit/embeddable-chat

Usage

Import the setup function and (optionally) the setRoom function:

import { FKChat, setRoom } from '@festkit/embeddable-chat'

The widget is transparent and doesn't set its own background color. If you're overlaying the widget over some content, you will need to set a background color or gradient on its container element.

To set up the widget:

FKChat('#chatBox', {
  accessToken: '<your access token>',
  user: {
    name: '<the users name>', // to be displayed on the chat message
    uid: '<the users id>' // the unique id for the user.
  }
})

As the user navigates around in your single-page app, you may want to update their room. To do this, simply use the setRoom function:

  setRoom('Rock Arena')

If you don't already have an accessToken, reach out to us to get your token.

API

FKChat

OptionTypeDescription
elementHTMLElement or CSS selector stringThe container in which the chat widget should be rendered.
optionsFKChatOptionsA set of config options (see writeup below).

FKChatOptions

OptionTypeDescription
accessTokenstringThe access token provided to you by Clapstream.
presentationstringThe kind of design to use for showing chat messages. Can be set to cards or compact (default: cards).
roomstringThe initial room to show on the user's chat messages (default: Home).
themestringIs the widget being shown against a dark background or a light background? (Default: light).
userUserDetailsThe details for the logged in user (see writeup below).

UserDetails

OptionTypeDescription
namestringThe name of the logged in user, shown on chat messages.
uidstringThe unique identifier for the logged in user.

setRoom

OptionTypeDescription
namestringThe name of the room to be shown on the user's chat messages.

License

You can check out the full license here

This project is licensed under the terms of the ISC license.

FAQs

Package last updated on 18 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts