Embedding In Websites
Dify Apps can be embedded in websites using an iframe. This allows you to integrate your Dify App into your website, blog, or any other web page.
When use Dify Chatbot Bubble Button embed in your website, you can customize the button style, position, and other settings.
Customizing the Dify Chatbot Bubble Button
The Dify Chatbot Bubble Button can be customized through the following configuration options:
Overriding Default Button Styles
You can override the default button style using CSS variables or the containerProps
option. Apply these methods based on CSS specificity to achieve your desired customizations.
1.Modifying CSS Variables
The following CSS variables are supported for customization:
To change the background color to #ABCDEF, add this CSS:
2.Using containerProps
Set inline styles using the style
attribute:
Apply CSS classes using the className
attribute:
3. Passing inputs
There are four types of inputs supported:
text-input
: Accepts any value. The input string will be truncated if its length exceeds the maximum allowed length.paragraph
: Similar totext-input
, it accepts any value and truncates the string if it’s longer than the maximum length.number
: Accepts a number or a numerical string. If a string is provided, it will be converted to a number using theNumber
function.options
: Accepts any value, provided it matches one of the pre-configured options.
Example configuration:
Note: When using the embed.js script to create an iframe, each input value will be processed—compressed using GZIP and encoded in base64—before being appended to the URL.
For example, the URL with processed input values will look like this:
http://localhost/chatbot/{token}?name=H4sIAKUlmWYA%2FwWAIQ0AAACDsl7gLuiv2PQEUNAuqQUAAAA%3D