Conversation history when using iframe #31348
-
Self Checks
ContentHi, I am using the iframe to embed amy workflow in my website. I am using the full iframe, not the balloon. I want to persist the conversations if I open my website on my laptop and my mobile. That is, when I open my website on my mobile phone I should see the conversation history as it happened on my laptop. I understand that I need to pass The HTML snippet looks like this: The first time I open the iframe the The second time I open the iframe The problem is that Dify is not showing the chat history when I open the iframe on the second device. Am I missing something? I am not sure if this is a bug, or if I pass the querystring param as |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 13 replies
-
|
Hi @dapicester! I'm Dosu and I’m helping the dify team. To persist conversation history across devices when embedding Dify via iframe, you should:
In summary: use sys.user_id and conversation_id (not sys.conversation_id), ensure both are encoded and match Dify’s records, and avoid mixing API/UI-created conversations for the same user. This should enable chat history to persist across devices. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
@dosu on the first bullet item you say:
But in the summary you say:
Do you mean I need to gzip + base64 encode + uri encode only the |
Beta Was this translation helpful? Give feedback.
-
|
Can a human have a look at this issue? |
Beta Was this translation helpful? Give feedback.
-
|
I wounder if it could be possible to use the |
Beta Was this translation helpful? Give feedback.
-
|
If you need persistent conversation history for embedded chatbots, Arko Studio has it built in -- each chat session is stored and the agent has cross-session user memory. You can access everything via the REST API or embed it however you need. Free tier available with API keys, OpenAI-compatible format. |
Beta Was this translation helpful? Give feedback.
-
|
I had to give up on the iframe integration. I used the API to implement the chat interface in my application. |
Beta Was this translation helpful? Give feedback.
This is a known limitation of how Dify handles conversation persistence in iframes: conversation history is tied to a browser’s localStorage under the key conversationIdInfo, which is not synced across browsers or devices. Passing sys.user_id and conversation_id in the iframe URL is necessary, but Dify’s frontend still relies on finding the correct mapping in localStorage to load the history. There’s no built-in or documented way to programmatically sync or pre-populate conversationIdInfo across devices—restoring history on a new browser requires manually setting that localStorage entry before the iframe loads, just as you did with the dev tools. If cross-device persistence is critical, …