Custom App Srorefront API

I created a custom app through the Shopify Dev Dashboard and selected access scopes for both the Admin API and Storefront API. However, I’m unable to find clear documentation on how to authenticate and access both APIs using a Dev Dashboard custom app.

I need help with the following:

  1. How to generate access tokens for a custom app and use them for both the Admin API and the Storefront API.

  2. The Admin API endpoint along with the required HTTP headers.

  3. The Storefront API endpoint along with the required HTTP headers.

You’ll either need to get an access token (admin) and then run the following mutation:

Or simply install the Hydrogen app which gets you a Storefront token.

Hi @Fullstack_Developer,

To add to @Luke’s answer here. You can use any of the available Authentication workflows to generate an Admin API token for a custom app, though for simplicity with custom apps specifically, we do recommend the new Client Credential Grant workflow.

  • Using the client credentials grant

    • The simplest authentication method currently available, however it is only available for Custom Apps created from the store organization owner.
    • For example if you are logged into the Dev Dashboard from your Partner account and create a custom app, this authentication method will only work on dev stores that your Partner Account owns. To use this with a merchants store, you will need to create the app in the Dev Dashboard while logged into a merchant staff account rather than your partner account.
  • Exchange a session token for an access token

    • For use with all embedded apps
  • Implement authorization code grant manually

    • For use with all non-embedded apps

More info on Authentication and Authorization can be found here:

Once you have the Admin Token from one of the methods listed above, you can then use the storefrontAccessTokenCreate Admin API mutation that @Luke mentioned to generate a Storefront API token.

As for the actual endpoints to use both the Admin and Storefront API, they are listed in the following reference documentation as such:

Admin API:

Storefront API:

Hi @Luke So this method - storefrontAccessTokenCreate - GraphQL Admin will also generate both public and private access storefront tokens as mentioned in the doc - Storefront API reference