Deploy your published web app on any website through iframes, chat widgets, or custom integrations
Your published web app can be embedded directly into any website. This isn’t a separate publishing method—it’s how you deploy the same web app you’ve already created, just presented within your existing website instead of as a standalone page.
The chat bubble presents your web app as a floating button. Visitors click it to open your app in an overlay—keeping them on your page while accessing your AI features.
Verify your app token matches what’s shown in Dify’s Publish → Embed section
Check that configuration loads before the embed script
Look for JavaScript errors in browser console
Iframe not loading:
Confirm the web app URL includes your correct token
Ensure your site allows iframe content (check Content Security Policy)
Both your site and Dify app should use HTTPS
Your web app must be published before embedding. If you update your app configuration, republish to see changes in embedded versions.
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.
window.difyChatbotConfig = { // ... other configurations containerProps: { style: { backgroundColor: '#ABCDEF', width: '60px', height: '60px', borderRadius: '30px', }, // For minor style overrides, you can also use a string value for the `style` attribute: // style: 'background-color: #ABCDEF; width: 60px;', },}
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