Skip to main content

shopifyApp

Returns a set of functions that can be used by the app's backend to be able to respond to all Shopify requests.

The shape of the returned object changes depending on the value of distribution. If it is AppDistribution.ShopifyAdmin, then only ShopifyAppBase objects are returned, otherwise ShopifyAppLogin objects are included.

Function to create a new Shopify API object.

<Config>
required

Configuration options for your Shopify app, such as the scopes your app needs.

<Config extends <Storage, Future>>

ShopifyApp An object constructed using your appConfig. It has methods for interacting with Shopify.

Set future flags using the future configuration field to opt in to upcoming breaking changes.

With this feature, you can prepare for major releases ahead of time, as well as try out new features before they are released.

Anchor to unstable_newEmbeddedAuthStrategy
unstable_newEmbeddedAuthStrategy
boolean
Default: false

When enabled, embedded apps will fetch access tokens via token exchange. This assumes the app has scopes declared for Shopify managing installation.

Learn more about this new embedded app auth strategy.

Examples

/shopify.server.ts

import { shopifyApp } from "@shopify/shopify-app-remix/server";

const shopify = shopifyApp({
apiKey: process.env.SHOPIFY_API_KEY!,
apiSecretKey: process.env.SHOPIFY_API_SECRET!,
scopes: process.env.SCOPES?.split(",")!,
appUrl: process.env.SHOPIFY_APP_URL!,
});
export default shopify;
Was this page helpful?