Improve environment variable handling
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
ProductSyncer,
|
||||
WebflowClient,
|
||||
} from "@blade-and-brawn/commerce";
|
||||
import { env } from "../env";
|
||||
|
||||
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
|
||||
@@ -26,15 +27,15 @@ const validateEquality = (wValue: any, pValue: any): Validation => {
|
||||
};
|
||||
|
||||
const printful = new PrintfulClient({
|
||||
token: Bun.env.PRINTFUL_AUTH!,
|
||||
storeId: Bun.env.PRINTFUL_STORE_ID!,
|
||||
token: env.PRINTFUL_AUTH,
|
||||
storeId: env.PRINTFUL_STORE_ID,
|
||||
});
|
||||
|
||||
const webflow = new WebflowClient({
|
||||
siteId: Bun.env.WEBFLOW_SITE_ID!,
|
||||
collectionsId: Bun.env.WEBFLOW_COLLECTION_ID!,
|
||||
token: Bun.env.WEBFLOW_AUTH!,
|
||||
webhookSecret: Bun.env.WEBFLOW_WEBHOOK_SECRET!,
|
||||
siteId: env.WEBFLOW_SITE_ID,
|
||||
collectionsId: env.WEBFLOW_COLLECTION_ID,
|
||||
token: env.WEBFLOW_AUTH,
|
||||
webhookSecret: env.WEBFLOW_WEBHOOK_SECRET,
|
||||
});
|
||||
|
||||
const syncer = new ProductSyncer(printful, webflow);
|
||||
|
||||
Reference in New Issue
Block a user