Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import "@shopify/shopify-app-remix/adapters/node";
- import {
- ApiVersion,
- AppDistribution,
- shopifyApp,
- BillingInterval,
- } from "@shopify/shopify-app-remix/server";
- import { PrismaSessionStorage } from "@shopify/shopify-app-session-storage-prisma";
- import { restResources } from "@shopify/shopify-api/rest/admin/2024-07";
- import prisma from "./db.server";
- export const MONTHLY_BASIC_PLAN = "Monthly Basic Plan";
- export const MONTHLY_PLUS_PLAN = "Monthly Plus Plan";
- export const MONTHLY_ADVANCED_PLAN = "Monthly Advance Plan";
- export const YEARLY_BASIC_PLAN = "Yearly Basic Plan";
- export const YEARLY_PLUS_PLAN = "Yearly Plus Plan";
- export const YEARLY_ADVANCED_PLAN = "Yearly Advance Plan";
- export const LIFETIME_BASIC_PLAN = "Lifetime Basic Plan";
- export const LIFETIME_PLUS_PLAN = "Lifetime Plus Plan";
- export const LIFETIME_ADVANCED_PLAN = "Lifetime Advance Plan";
- const shopify = shopifyApp({
- apiKey: process.env.SHOPIFY_API_KEY,
- apiSecretKey: process.env.SHOPIFY_API_SECRET || "",
- apiVersion: ApiVersion.July24,
- scopes: process.env.SCOPES?.split(","),
- appUrl: process.env.SHOPIFY_APP_URL || "",
- authPathPrefix: "/auth",
- sessionStorage: new PrismaSessionStorage(prisma),
- distribution: AppDistribution.AppStore,
- restResources,
- billing:{
- [MONTHLY_BASIC_PLAN]:{
- amount: 9.99,
- currencyCode: "USD",
- interval: BillingInterval.Every30Days,
- },
- [MONTHLY_PLUS_PLAN]:{
- amount: 15.99,
- currencyCode: "USD",
- interval: BillingInterval.Every30Days,
- },
- [MONTHLY_ADVANCED_PLAN]:{
- amount: 29.99,
- currencyCode: "USD",
- interval: BillingInterval.Every30Days,
- },
- [YEARLY_BASIC_PLAN]:{
- amount: 107.99,
- currencyCode: "USD",
- interval: BillingInterval.EveryYear,
- },
- [YEARLY_PLUS_PLAN]:{
- amount: 172.99,
- currencyCode: "USD",
- interval: BillingInterval.EveryYear,
- },
- [YEARLY_ADVANCED_PLAN]:{
- amount: 323.99,
- currencyCode: "USD",
- interval: BillingInterval.EveryYear,
- },
- [LIFETIME_BASIC_PLAN]:{
- amount: 323.99,
- currencyCode: "USD",
- interval: BillingInterval.OneTime,
- },
- [LIFETIME_PLUS_PLAN]:{
- amount: 518.99,
- currencyCode: "USD",
- interval: BillingInterval.OneTime,
- },
- [LIFETIME_ADVANCED_PLAN]:{
- amount: 971.99,
- currencyCode: "USD",
- interval: BillingInterval.OneTime,
- },
- },
- future: {
- unstable_newEmbeddedAuthStrategy: true,
- },
- ...(process.env.SHOP_CUSTOM_DOMAIN
- ? { customShopDomains: [process.env.SHOP_CUSTOM_DOMAIN] }
- : {}),
- });
- export default shopify;
- export const apiVersion = ApiVersion.July24;
- export const addDocumentResponseHeaders = shopify.addDocumentResponseHeaders;
- export const authenticate = shopify.authenticate;
- export const unauthenticated = shopify.unauthenticated;
- export const login = shopify.login;
- export const registerWebhooks = shopify.registerWebhooks;
- export const sessionStorage = shopify.sessionStorage;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement