AppBridgeError: APP::ERROR::INVALID_CONFIG: not a valid host, please use the value provided by Shopi

sohailbukhari
New Member
2 0 0

AppBridgeError: APP::ERROR::INVALID_CONFIG: not a valid host, please use the value provided by Shopify

I have upgraded @Shopify/app-bridge-react from v1.30.0 to v2.0.2-alpha.2

shopify throws me the error for host param 

My CODE : 
  
    const config = { apiKey: API_KEY, host: HOST, shopOrigin, forceRedirect: true };
 
i have already tried it with resolving with ngrok host not working either.
0 Likes
jeff75
Shopify Staff
Shopify Staff
2 0 0

Hey @sohailbukhari -

Can you try passing your config without passing the shopOrigin parameter?  Like below:

const config = { apiKey: API_KEY, host: HOST, forceRedirect: true };

 
Thanks,
Jeff

0 Likes
xosblo91
New Member
1 0 0

Hi @jeff75 

How would I get the host in the first place?

Thank you

0 Likes
sheldonn
Shopify Staff
Shopify Staff
1 0 0

The Shopify admin provides the host parameter as part of the app URL when loading your embedded app.

Example:

https://example.org/?hmac={hmac}&host={base64_encoded_hostname}&session={session}&shop={shop_origin}&timestamp=1409617544

 

You can learn more about this parameter in our Migrate your app from Shopify App Bridge 1.x to Shopify App Bridge 2.0 guide

0 Likes