App Bridge Error: INVALID_CONFIG: Not A Valid Host, Please Use The Value Provided By Shopify

ezazpatel
Shopify Partner
2 0 1

Hello nice supporters!

 

I tried searching high and low for a solution but couldn't find one. There is another thread on the same topic but that solution didn't work for me either!

So here is my code and error which App Bridge returns (see attached screenshots)

 

https://goshoplocal.com/vendor.php?dispatch=mc__shopify_connector_vendors.install_app&hmac=2794094bf...

 

I also added request which was sent by Shopify. Host is encoded in request and it is definetely maxi-cart-test1.myshopify.com/admin


So I don't really understand what this error is about.

 

2.jpg1.jpg

Replies 2 (2)

MitchLillie
Shopify Staff
5 0 1

Hello,

 

Thanks for reaching out. The issue you're seeing is because you've hardcoded the `host` value. Per our documentation for Retrieve the host:

 

"The host is provided as a URL query parameter appended to your application URL when your app is loaded inside the Shopify admin. The host parameter is an encoded version of the shop origin"

 

Rather than hardcoding the value, try retrieving it from the URL. Hope this helps!

To learn more visit the Shopify Help Center or the Community Blog.

Aurnik
Shopify Partner
51 1 4

A couple things:

  1. It'd be helpful to understand how you get to this page in the first place. Is this after installing the app? Is this the auth callback?
  2. Looks like you're passing a Shopify Admin url as a host, you might be able to understand the host parameter better here.
Product Embed - embed products into blog posts - shopify.com/product-embed
Blog Sync - copy new & updated blog posts across stores - shopify.com/blog-sync