ctrlaltdylan / shopify-nextjs-toolbox

A set of tools to authenticate NextJs apps with Shopify's OAuth handshake and AppBridge Session Tokens
161 stars 21 forks source link

AppBridge v2 Support #6

Closed ctrlaltdylan closed 3 years ago

ctrlaltdylan commented 3 years ago

Terrible branch name, but this will support v2 of the AppBridge as well as v1.

The only big difference from v1 to v2 is this new host parameter required on AppBridge instantiation instead of shopOrigin.

One big issue though.

It seems like Shopify's OAuth flow has yet to provide this new host parameter. I'm trying to have this addressed by Shopify here:

https://community.shopify.com/c/Shopify-APIs-SDKs/App-Bridge-v2-required-host-parameter-is-missing-from-the-OAuth/m-p/1122081#M64862

This PR includes tests that provide the entire query string is passed from the backend to the frontend, however it the package can't just create a host without a specification.

I'm staying tuned to that forum topic to get an answer (soon hopefully).

Once that is resolved, this will be a tagged release with the corresponding example repo.

devopsangel commented 3 years ago

@ctrlaltdylan Love it! It looks awesome!

chickencoder commented 3 years ago

Great work. Thanks for this repo @ctrlaltdylan. Trying to understand how this is still an issue on Shopify's ends. Does it only affect the way this repo works or all apps trying to use AppBridge V2? Seems like apps are being rejected for using AppBridge V1 so not sure how this could be.