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

front-chat-sdk

v1.1.2

Published

Front Chat SDK

Downloads

433

Readme

Contributors Forks Stargazers Issues Apache 2.0 License

About The Project

This repository contains examples to demonstrate how Front Chat can be launched on a variety of web pages. The core example demonstrates how the useFrontChat hook can be applied to quickly launch a chat widget in a React application, and there is also an example of using the generic initialize function to launch Front Chat on any kind of web page.

For more advanced use cases, there are two additional helpers: useFrontChatBoot and boot.

To learn more about Front Chat, check out this article from Front.

Getting Started

We now have an npm package available!

npm i front-chat-sdk
import {initialize} from 'front-chat-sdk/helpers';
import {useFrontChat} from 'front-chat-sdk/hooks';
import type {FrontChat} from 'front-chat-sdk/types';

See examples for more on how to use front-chat-sdk.

Running front-chat-sdk locally

Install and Run

  1. Clone the repo
    git clone https://github.com/frontapp/front-chat-sdk.git
  2. Install packages
    npm install
  3. Run the example application
    npm run dev

After the last command, the example application can be accessed at http://localhost:5173/

Usage

There are four helpers provided in this repository, and each of them is used in the examples directory.

We have also provided additional examples for common use cases. These examples use React, but the general principles should work for any application.

Quick-start Helpers

  • initialize
    • An async function that boots and initializes a Front Chat widget. The returned Promise is only resolved once the chat widget application is fully running and initialized inside its iframe.
  • useFrontChat
    • A React hook that boots and initializes a Front Chat widget while adhering to the React component lifecycle.

Advanced Helpers

  • boot
    • An async function that boots the Front Chat widget and returns helpers to interact with the Front Chat SDK. The returned Promise is only resolved once the chat widget application is fully running inside its iframe.
  • useFrontChatBoot
    • A React hook that boots the Front Chat widget and provides helpers to initialize the application while adhering to the React component lifecycle.

Feedback

Although this package is maintained by Front, feedback is greatly appreciated. Feel free to open an issue if you have any suggestions as to how this repository and its examples could be improved.

Contact

Front Support - https://help.front.com/en/contact-us

Please mention that you are experiencing issues with Front Chat or front-chat-sdk, so that they can direct you to a member of the Live Chat team.

Project Link: https://github.com/frontapp/front-chat-sdk

License

Distributed under the Apache 2.0 License. See LICENSE for more information.