dify icon indicating copy to clipboard operation
dify copied to clipboard

Unable to Pass Parameters When Embedding Dify Chat Interface via iframe

Open TAXID911101087886396267 opened this issue 1 year ago • 11 comments

Self Checks

  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Description:

I'm encountering an issue while embedding the Dify chat interface into my webpage using an iframe. Despite following the official documentation, I am unable to pass parameters, such as sys.user_id, to the chat interface.

Steps to Reproduce:

Embed the Dify chat interface into a webpage using the provided iframe code.

Attempt to pass parameters (e.g., sys.user_id) through the iframe's URL or via JavaScript configuration.

Observe that the parameters are not being recognized or utilized by the chat interface.

Expected Behavior:

The embedded chat interface should accept and process parameters passed through the iframe, allowing for dynamic customization based on the provided values.

Actual Behavior:

The parameters passed to the iframe are not being acknowledged, resulting in a static chat interface without the intended customizations.

Request:

Could you provide guidance on how to successfully pass parameters to the Dify chat interface when embedding it via an iframe? If this functionality is not currently supported, are there any recommended workarounds or plans to implement this feature in future releases?

2. Additional context or comments

I have reviewed the following resources but have not found a solution:

Embedding In Websites - Dify Documentation

Pass input parameters to iframe #5575

Can pass some params to iframe src after publish as a public chat #2841

3. Can you help us with this feature?

  • [ ] I am interested in contributing to this feature.

TAXID911101087886396267 avatar Jan 06 '25 07:01 TAXID911101087886396267