Minor Changes
Add support for merchant custom apps
Merchant custom apps or apps that are distributed by the Shopify Admin are now supported.
These apps do not Authorize by OAuth, and instead use a access token that has been generated by the Shopify Admin.
Apps of this type are standalone apps and are not initiated from the Shopify Admin. Therefore it is up to the developer of the app to add login and authentication functionality.
To use this library with Merchant Custom Apps set the following configuration in the shopify.server
file:
const shopify = shopifyApp({
apiKey: "your-api-key",
apiSecretKey: "your-api-secret-key",
adminApiAccessToken:"shpat_1234567890",
distribution: AppDistribution.ShopifyAdmin,
appUrl: "https://localhost:3000",
isEmbeddedApp: false,
Session storage is not required for merchant custom apps. A session is created from the provided access token.
At this time merchant custom apps are not supported by the Shopify CLI. Developers will need to start the development server directly.
npm exec remix vite:dev
You can then access the the app at `http://localhost:3000/app?shop=my-shop.myshopify.com`
-
9cba2d3: Allow responses from afterAuth to bubble up to the Remix loader
-
071ec13: Make session storage optional for merchant custom apps
Providing a session storage to the
shopifyApp()
function is now optional for apps with a distribution ofAppDistribution.ShopifyAdmin
. Apps with this distribution create the session from the configured access tokens. -
d022f8c: Change
billing.check
andbilling.subscription
to work without a billing config, so apps can use Shopify managed pricing. -
e69f4a8: # Add Admin path parsing to redirect
You can now pass in an admin path to the redirect function to redirect to a page in the Shopify Admin. This uses the same syntax App Bridge uses to redirect to the Shopify Admin.
export const action = async ({request}: ActionFunctionArgs) => { const {redirect} = await authenticate.admin(request); return redirect(`shopify://admin/products/123456`, {target: '_top'}); };
-
1aa226b: Return headers in responses from GraphQL client.
Headers are now returned in the response object from the GraphQL client.
In apps using the
@shopify/shopify-app-remix
package the headers can be access as follows:const response = await admin.graphql( ... const responseJson = await response.json(); const responseHeaders = responseJson.headers const xRequestID = responseHeaders? responseHeaders["X-Request-Id"] : ''; console.log(responseHeaders); console.log(xRequestID, 'x-request-id');
Patch Changes
- 207b9d8: Throw a 500 response instead of a redirect if we detect a redirect loop in /auth/login.
- badbdde: Allow _blank targets in the redirect helper
target
option. - Updated dependencies [05fb23d]
- Updated dependencies [192cc6b]
- Updated dependencies [06793fb]
- Updated dependencies [3a0a3d4]
- Updated dependencies [1aa226b]
- Updated dependencies [3cf3c56]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]