Create an account at Fini AI to get started
Deploy Fini widget
Guide consists of 5 main sections:- Connections details
- General setup
- Replies setting
- Branding
- Deploying Fini widget
Connections details
1
Go to Deploy tab

2
Go to widget -> Generate

3
Click on create new

4
Select Bot
Select the bot that you want to use for your widget

General setup
1
Add Domain
You have 3 options while you select the domain:
- Enter specific domain: For eg:
https://www.usefini.com- when you do this your widget will only work on the selected website. - Enter partial domain : For eg:
*.usefini.com- you can choose this when you want to use the widget across differents parts of your product (eg: app, website etc.) - Enter “null”: when you want your widget to work across domains you can enter “null” and then you can deploy it across domains

2
Select widget title

3
Insert Widget Description

Replies setting
1
Add Welcome message
This is the message your users will see when they open the widget


2
Add pre-defined questions
It’s an optional step. If you foresee common questions among your users you can make it easier for them by adding pre-defined questions


Branding
In this section you can decide on the appearance of your widget including logo and color.
1
Show reference links
Select if you want to show the reference links used by the bot to generate it’s response. Note: We will only show public links.


2
Select your brand color

3
Upload your logo

4
Click on create

5
Go back to Settings

6
Adjust streaming
Streaming is a feature that allows users to enjoy a more natural, human-like experience by streaming words in the response, rather than receiving the entire reply all at once.Please note that this functionality can impact Fini’s performance, potentially leading to a decrease in the accuracy of the replies since we turn off additional features like LLM evaluation while streaming

7
Click on save

Review widget configuration
1
Click on Preview -> Widget
Preview your widget and make any adjustment if needed


2
Select widget
Click on the logo in the right bottom side of the website


Deploy widget
1
Select Embed Script

2
Copy code
Copy and paste this script to the HTML file of your website. Must put the snippet inside or after the body tag!
Finiwidget.html
User Authentication (Optional)
If you want to identify and authenticate users in your widget, you can implement JWT-based authentication. This allows you to track conversations by user and provide personalized experiences.1
Understand the authentication flow
User authentication with Fini widget works by passing a JSON Web Token (JWT) to the widget script. This token securely identifies your users and allows you to:
- Track conversations by specific users
- Provide personalized responses
- Maintain conversation history per user
- Access user-specific analytics
2
Generate a JWT token
Create a JWT token on your backend using the Fini signing key. Important: Never expose this signing key in your frontend code.Signing Key:Required JWT Payload:
The
email field is required. The name and user_attributes fields are optional but recommended for better user tracking and personalization.3
Pass the JWT to the widget
Once you have generated the JWT token on your backend, pass it to the widget via the
customerToken parameter:Security Best Practice: Generate the JWT token on your server-side and pass it to your frontend. Never include the signing key in your client-side code as this would compromise the security of your authentication system.
4
Implementation example
Here’s a typical flow for implementing authenticated widgets:
- Backend: When a user logs into your application, generate a JWT token using the signing key
- Frontend: Receive the token from your backend API
- Widget: Pass the token to the
customerTokenparameter in the widget initialization script - Fini: The widget validates the token and associates all conversations with the authenticated user
If you don’t need user authentication, you can skip this section entirely. The widget will work without the
customerToken parameter, but conversations won’t be associated with specific users.Fini Widget set up is complete. If you wish to change some of the settings go back to the Deploy Page and edit your configurations in the settings tabFor any additional configurations or queries, reach out to hello@usefini.com