How to pass information from Shopify app to Checkout Extension?

Solved

How to pass information from Shopify app to Checkout Extension?

triplesingle
Shopify Partner
22 0 1

I am currently building a Shopify app with a Checkout UI Extension using Shopify's default Remix boilerplate. The shopify app utilizes the eventStream API from Remix to implement server side event messages.

 

I was just wondering is there any way to pass these event messages from the App to the Checkout UI Extension?


It seems that even though the Extension is in the same repo, it resides in its own siloed environment and that the only way for it to access data is via these APIs: https://shopify.dev/docs/api/checkout-ui-extensions/2024-01/apis

Alternatively, how could I implement SSE within the Extension itself without having to poll an endpoint with useEffect?

Accepted Solution (1)

Huptech-Web
Shopify Partner
940 188 197

This is an accepted solution.

Hello @triplesingle 

You can make a Proxy route in your Shopify app for your checkout extension. First, allow network access permission in your admin panel. Also, add [shopify.extension.toml] file with 'network_access = true'. Then, you can easily use the fetch function to interact with the API.

 

Screenshot.pngScreenshot_1.png

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at [email protected] or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required

View solution in original post

Replies 2 (2)

Huptech-Web
Shopify Partner
940 188 197

This is an accepted solution.

Hello @triplesingle 

You can make a Proxy route in your Shopify app for your checkout extension. First, allow network access permission in your admin panel. Also, add [shopify.extension.toml] file with 'network_access = true'. Then, you can easily use the fetch function to interact with the API.

 

Screenshot.pngScreenshot_1.png

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at [email protected] or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
Huptech-Web
Shopify Partner
940 188 197

Hello @triplesingle 

If the solution presented meets your needs and addresses your query effectively, I encourage you to accept it as the chosen answer. This will acknowledge the support you received and aid fellow community members in identifying reliable and effective solutions for their similar concerns.

Thank you.

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at [email protected] or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required