Skip to content
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

Pass data/state to the embedded app #1281

Closed
michaelbromley opened this issue Dec 10, 2021 Discussed in #1280 · 1 comment
Closed

Pass data/state to the embedded app #1281

michaelbromley opened this issue Dec 10, 2021 Discussed in #1280 · 1 comment

Comments

@michaelbromley
Copy link
Member

Discussed in #1280

Originally posted by tomas7 December 10, 2021
It would be very helpful to have an option to pass data (either product slug or id) to addActionBarItem as a payload or parameter and access it in the embedded app (React).

My user case: Venture admin-UI is extended by react-app. React component is fetching data from another API based on selected product (slug/id), button addActionBarItem is located at product-details. When I try to pass the ID to the URL, react component can't access it.

image

Is there any workaround?

Request created based on @michaelbromley from Vendure Slack Channel.

Original comment: We are lacking an API that allows you to easily access state from your embedded app.
This can be added though - we can use the same PostMessage channels that we already use to securely pass data to the data service & notification service. Could you open a feature request for this?

Thank you for any help,
Tomas

@michaelbromley
Copy link
Member Author

Added a new function to the ui devkit client, getActivatedRoute(). Will be documented in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant