dreame-shopify-app/app/shopify.server.ts

24 lines
975 B
TypeScript
Raw Permalink Normal View History

2026-06-19 00:53:13 +08:00
import "@shopify/shopify-app-remix/adapters/node";
import { AppDistribution, shopifyApp } from "@shopify/shopify-app-remix/server";
import { PrismaSessionStorage } from "@shopify/shopify-app-session-storage-prisma";
import db from "./db.server";
const shopify = shopifyApp({
apiKey: process.env.SHOPIFY_API_KEY || "",
apiSecretKey: process.env.SHOPIFY_API_SECRET || "",
apiVersion: "2026-01" as never,
scopes: (process.env.SCOPES || "read_orders,read_metaobjects,write_metaobjects,write_metaobject_definitions").split(","),
2026-06-19 00:53:13 +08:00
appUrl: process.env.SHOPIFY_APP_URL || "",
authPathPrefix: "/auth",
sessionStorage: new PrismaSessionStorage(db),
distribution: AppDistribution.SingleMerchant,
2026-06-19 00:53:13 +08:00
future: {
unstable_newEmbeddedAuthStrategy: true,
},
});
export default shopify;
export const authenticate = shopify.authenticate;
export const unauthenticated = shopify.unauthenticated;
export const addDocumentResponseHeaders = shopify.addDocumentResponseHeaders;