How to get 'host' parameter for App Bridge, if it's not in the URL ?

How to get 'host' parameter for App Bridge, if it's not in the URL ?

seymur_crsp
Shopify Partner
67 4 10

To create a new instance of createApp from App Bridge we need the host, which according to the documentation:

"The host is provided as a URL query parameter appended to your application URL when your app is loaded inside the Shopify admin."

But when I load the app absolutely no parameters are there in the URL. The only place I see that parameter is the sharable link that is shown in the terminal when I run "npm run dev".

How should I get and store the host then ?

Replies 2 (2)

bmc121177
Shopify Partner
2 0 0

Did you ever figure out how to get around this?  I'm running into a similar issue where I'm missing the host query param on my production deploys.  Using "npm run dev" in my development environment works and runs as expected.

Goosey
Shopify Partner
2 0 0

Anyone else find a solution for this?