Skip to content

Commit

Permalink
🔧 (.env.example, Dockerfile, make-shopify-request.server.ts, vite.con…
Browse files Browse the repository at this point in the history
…fig.ts): add SHOPIFY_API_EXTERNAL_SECRET to support external Shopify API integration
  • Loading branch information
sebpalluel committed Jul 3, 2024
1 parent 72600f7 commit 56c5e50
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ OFFLINE_WEB_API_URL='https://parenting-card-cologne-enhance.trycloudflare.com/ap
# OFFLINE_WEB_API_URL='https://www.staging.offline.live/api/shopify'
OFFLINE_GATES_SHOPIFY_SECRET='gqIjvMryDG8pGDeSUb0dIhoBde6BkOaM0Qxbuhze3jk='
DATABASE_URL="postgres://postgres:password@localhost:5247/postgres"
SHOPIFY_API_EXTERNAL_SECRET='85d5868a6566e6725951bf7100d45f44'

2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ARG OFFLINE_GATES_HANDLE
ENV OFFLINE_GATES_HANDLE=$OFFLINE_GATES_HANDLE
ARG DATABASE_URL
ENV DATABASE_URL=$DATABASE_URL
ARG SHOPIFY_API_EXTERNAL_SECRET
ENV SHOPIFY_API_EXTERNAL_SECRET=$SHOPIFY_API_EXTERNAL_SECRET

EXPOSE 3000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export async function makeShopifyProxyRequest<T>(

const signature = createShopifyProxySignature(
requestParams,
process.env.SHOPIFY_API_SECRET as string,
process.env.SHOPIFY_API_EXTERNAL_SECRET as string,
);

const queryParams = populateQueryParams({
Expand Down
4 changes: 4 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export default defineConfig(({ mode }) => {
if (!env.OFFLINE_WEB_API_URL)
throw new Error("OFFLINE_WEB_API_URL is required");

if (!process.env.SHOPIFY_API_EXTERNAL_SECRET) {
throw new Error("SHOPIFY_API_EXTERNAL_SECRET is required");
}

if (!env.OFFLINE_GATES_HANDLE)
throw new Error("OFFLINE_GATES_HANDLE is required");
return {
Expand Down

0 comments on commit 56c5e50

Please sign in to comment.