Replies: 1 comment 2 replies
-
|
Hi @imkiven! I'm Dosu and I’m helping the dify team. To set systemVariables when embedding a Dify app in an import pako from 'pako';
function encodeValue(value) {
const uint8Array = new TextEncoder().encode(value);
const gzipped = pako.gzip(uint8Array);
const base64 = btoa(String.fromCharCode(...gzipped));
return encodeURIComponent(base64);
}
// Usage:
const encodedUserId = encodeValue('your_user_id');
const iframeUrl = `https://your-dify-host/chatbot/{token}?sys.user_id=${encodedUserId}`;You can use any key with the Keep the total URL length under 2048 characters to avoid loading issues. Do not pass secrets or sensitive data via URL parameters—these are exposed to browser history and inspection. Use HTTPS for transport security, but remember this does not protect against exposure in logs or browser tools. For more details, see the official documentation and embed.js implementation. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
How to set systemVariables when embedding a web page in <iframe>
Beta Was this translation helpful? Give feedback.
All reactions