Shopify / shopify-app-template-node

MIT License
875 stars 395 forks source link

Fix server-side rendering for App Bridge v4 #1327

Closed paulomarg closed 1 month ago

paulomarg commented 5 months ago

WHY are these changes introduced?

As part of updating the template to use App Bridge React v4, we'll need to include the api key in the index.html file, which is served by the backend of the app.

Vite will handle replacing it in client-side renders, which is why the variable needs to start with a VITE_.

WHAT is this pull request doing?

Dynamically replacing the api key when serving that file.