Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .talismanrc

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021-2025 Contentstack
Copyright (c) 2021-2026 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file removed live-preview-shopify-utils-1.0.0.tgz
Binary file not shown.
191 changes: 123 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shopify-live-preview-middleware",
"version": "1.0.0",
"version": "1.1.0",
"description": "Shopify Live Preview Middleware Service",
"type": "module",
"main": "src/index.ts",
Expand All @@ -21,16 +21,16 @@
"format": "prettier --write \"src/**/*.ts\""
},
"dependencies": {
"@contentstack/shopify-live-preview-sdk": "file:contentstack-shopify-live-preview-sdk-1.0.0.tgz",
"@contentstack/shopify-live-preview-sdk": "^1.1.0",
"@fastify/cors": "^8.3.0",
"@fastify/rate-limit": "^9.1.0",
"@fastify/swagger": "^8.8.0",
"@fastify/swagger-ui": "^3.0.0",
"adm-zip": "^0.5.10",
"axios": "^1.9.0",
"dotenv": "^16.5.0",
"fastify": "^4.21.0",
"fastify-plugin": "^4.5.1",
"live-preview-shopify-utils": "file:live-preview-shopify-utils-1.0.0.tgz",
"lodash": "^4.17.21",
"pino-pretty": "^10.2.0"
},
Expand Down
10 changes: 10 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ interface Config {
environment: string;
apiKey: string;
previewUrl?: string;
rateLimit?: {
max: number;
timeWindow: string;
};
};
}

Expand All @@ -21,5 +25,11 @@ export const config: Config = {
environment: process.env.CONTENTSTACK_ENVIRONMENT || '',
apiKey: process.env.CONTENTSTACK_API_KEY || '',
previewUrl: process.env.CONTENTSTACK_PREVIEW_URL || 'https://rest-preview.contentstack.com',
rateLimit: {
// Set the maximum number of requests allowed per time window.
// Tries to read RATE_LIMIT_MAX from environment variables, falls back to 100 if not set or not a valid number.
max: parseInt(process.env.RATE_LIMIT_MAX || '100', 10) || 100,
timeWindow: process.env.RATE_LIMIT_TIME_WINDOW || '1 minute',
},
},
};
Loading