A Typescript notebook for developing, prototyping, and sharing software.
Explore the docs »
Front
·
Report Bug
·
Request Feature
Table of Contents
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.
- Clone the repo
git clone https://github.com/frontapp/front-chat-sdk.git
- Install packages
npm install
- Run the example application
npm run dev
After the last command, the example application can be accessed at http://localhost:5173/
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.
- How to embed a Front Chat widget directly in a page.
- How to initialize a Front Chat widget with a verified user.
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.
- An async function that boots and initializes a Front Chat widget. The returned
useFrontChat
- A React hook that boots and initializes a Front Chat widget while adhering to the React component lifecycle.
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.
- An async function that boots the Front Chat widget and returns helpers to interact with the Front Chat SDK. The returned
useFrontChatBoot
- A React hook that boots the Front Chat widget and provides helpers to initialize the application while adhering to the React component lifecycle.
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.
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
Distributed under the Apache 2.0 License. See LICENSE
for more information.