Skip to content

FEATURE: allow passing in data attributes to an artifact #1346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2025

Conversation

SamSaffron
Copy link
Member

@SamSaffron SamSaffron commented May 18, 2025

Also allow artifact access to current username

Usage inside artifact is:

  1. await window.discourseArtifactReady;
  2. access data via window.discourseArtifactData;
<div class="ai-artifact" data-ai-artifact-id="482" data-hello="world"></div>

image

Also allow artifact access to current username

Usage inside artifact is:

1. await window.discourseArtifactReady;
2. access data via window.discourseArtifactData;
Copy link
Contributor

@nattsw nattsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general naturally I am worried about data security but it looks like it should be fine since this is supplied by the backend. One thing that I thought about was user anonymity (e.g. exposing the username) but I think it's only names that we tend to hide, not usernames.

@SamSaffron
Copy link
Member Author

thanks, yeah leaking usernames I think is ok in this case. you need to be pretty trusted to make artifacts anyway.

@SamSaffron SamSaffron merged commit 3ac2359 into main May 19, 2025
6 checks passed
@SamSaffron SamSaffron deleted the various-things branch May 19, 2025 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants