Skip to content

Commit 47fa453

Browse files
authored
Merge pull request #930 from gadget-inc/add-shopid-to-background
Add Shop ID support to background actions
2 parents cfe5fb1 + 7778402 commit 47fa453

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/core/src/types.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,21 @@ export type EnqueueBackgroundActionOptions<Action extends AnyActionFunction> = {
934934
* startAt: new Date(new Date().getTime() + 60 * 1000)
935935
*/
936936
startAt?: Date | string;
937+
938+
/**
939+
* The Shopify shop ID to associate with this background action for intelligent rate limiting.
940+
*
941+
* When provided, Gadget will automatically manage the execution of enqueued background actions based on your app's
942+
* available Shopify API rate limit capacity. If your app is being rate limited by Shopify, Gadget will defer
943+
* execution and only process actions when there is sufficient rate limit headroom to complete them successfully.
944+
*
945+
* If not provided, the action will be executed immediately without any rate limit awareness, which may result
946+
* in Shopify API errors if your app is under heavy load.
947+
*
948+
* @example
949+
* shopifyShop: "82277368081"
950+
*/
951+
shopifyShop?: string;
937952
} & Partial<OperationContext>;
938953

939954
export type BackgroundActionResultData<

0 commit comments

Comments
 (0)