npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@festkit/embeddable-chat

v1.0.6

Published

## Installation

Downloads

3

Readme

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'

To set up the widget:

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

The widget doesn't have any height or width of its own and expands to fill the container element. Also, the widget is transparent so if you're overlaying the widget over some content, you will need to set a background color or gradient on its container element.

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')

You can generate a session token for your user by making a request to https://embeddable-chat.vercel.app/token with your Access Key and Secret.

Getting a session token

To get a session token, make the following request from your backend:

POST https://embeddable-chat.vercel.app/token

Headers:

|Header|Value| |------|-----| |Accept|application/json| |Content-Type|application/json|

Body:

{
  "key": "<your access key>",
  "secret": "<your access secret>",
  "uid": "<the user's unique ID on your system>"
}

Reach out to us to get an Access Key and Secret for your project.

API

FKChat

| Option | Type | Description | |---------|---------------------------|-------------| |element| HTMLElement or CSS selector string | The container in which the chat widget should be rendered. | |options| FKChatOptions | A set of config options (see writeup below). |

FKChatOptions

| Option | Type | Description | |-------------|----------------------------------------|-------------| |accessKey| string | The Access Key provided to you by Clapstream. | |sessionToken| string | The session token generated by calling https://embeddable-chat.vercel.app/token. | |presentation| string | The kind of design to use for showing chat messages. Can be set to cards or compact (default: cards). | |room| string | The initial room to show on the user's chat messages (default: Home). | |theme| string | Is the widget being shown against a dark background or a light background? (Default: light). | |user| UserDetails | The details for the logged in user (see writeup below). |

UserDetails

| Option | Type | Description | |-------------|----------------------------------------|-------------| |name| string | The name of the logged in user, shown on chat messages. | |uid| string | The unique identifier for the logged in user. |

setRoom

| Option | Type | Description | |-------------|----------------------------------------|-------------| |name| string | The 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.