Understanding authorisation of custom Shopify apps

I have a shopify partner account and I make multiple custom shopify apps for different clients. I have have yet to understand if how I make my customer install the app is best practice.

I have a web platform built using Next.js and I’m using the javascript library where I manually set up the secrets and client ids as environment variables which I use to start the OAuth flow. But there is an issue, users always get this error message with the install button grayed out.

This app can't be installed using this link. Contact the app developer for more information.

Here is how I by pass the issue today:

  1. Create a custom app and set it up in my platform with credentials and secrets

  2. Have customer first go to the link found under Distribution when you click on a tab in the partner app dashboard
    enter image description here

  3. Have the customer install the app by triggering the Oauth flow in my web platform.

If i don’t perform step 2 then the user gets the error message. Step 2 also has to be performed whenever there is an uninstallation of the app.
To clarify why step 3 is needed: I need to ensure that the user has created an account and is logged into my platform in order to save the credentials and token returned by the OAuth process together with the user_id that my platform creates.

I’m I completely missing the mark here or is it supposed to be this complicated?

Leave a Comment