Thanks for the advice.
However, my app was recently rejected stating that I needed to upgrade to AppBridge v2 so I’m a little confused what to do since v2 isn’t working.
Thanks for the advice.
However, my app was recently rejected stating that I needed to upgrade to AppBridge v2 so I’m a little confused what to do since v2 isn’t working.
Yep, we are required to upgrade to v2 by end of 2021
Hello,
I am not sure if your stack is the same but I received a working workaround from a Shopify Staff.
How am I supposed to submit my app then if v2 isn’t working yet?
(they rejected it because I was using v1)…
You can find host here:
use it to create your hmac to compare to Shopify’s (code, host, shop, state, timestamp)
Thank you! I was able to find the host and set the config variable
Does anyone know how to add the host param when using the useAppBridge hook?
const app = useAppBridge();
const redirectToProduct = () => {
const redirect = Redirect.create(app);
redirect.dispatch(
Redirect.Action.APP,
‘/edit-products’,
);
};
Results in INVALID_CONFIG: host must be provided still even when host is provided in _app.js
Option #2
Only if you absolutely must. But if you’re going with nodejs and koa-shopify-auth, it’s all handled for you and proper encoded host will be made available upon completion of the client auth process.
const params = new URLSearchParams(window.location.search);
const query = {
host: params.get("host"),
shop: params.get("shop")
};
// base64 encode "shop/admin" if query.host is absent
let host = query.host || btoa(`${query.shop}/admin`);
const provider = ;