@bss-sbc/shopify-rest-api-rate-limiter
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "@bss-sbc/shopify-rest-api-rate-limiter", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -19,1 +19,31 @@ # Shopify REST API Rate Limiter | ||
### Example | ||
```javascript | ||
// To bulk initialize | ||
const shops = [ | ||
{ id: 1, domain: 'dev-mida-dean.myshopify.com' }, | ||
{ id: 2, domain: 'dev-mida-store.myshopify.com' }, | ||
] | ||
const intialized = BucketManager.initializeAll(shops); | ||
// To initialize | ||
BucketManager.initializeOne({ | ||
id: 1, | ||
domain: 'dev-mida-dean.myshopify.com', | ||
}); | ||
// To get specific bucket | ||
const bucket = BucketManager.get('dev-mida-dean.myshopify.com'); | ||
// To clean up specific bucket | ||
BucketManager.clear('dev-mida-dean.myshopify.com'); | ||
// Auto initialize bucket, | ||
// using safeFetch | ||
const response = await safeFetch(domain, url, params); | ||
``` | ||
### Roadmap | ||
Because of numbers of `microservices`, it is difficult to listen to `app/uninstalled` webhook event. So, auto clear bucket is necessary |
16463
49