Webhook
Contains functions for verifying Shopify webhooks.
Verifies requests coming from Shopify webhooks.
- Anchor to requestrequestrequestRequestRequestrequiredrequired
WebhookContext
- admin
undefined - apiVersion
The API version used for the webhook.
string - payload
The payload from the webhook request.
JSONValue - session
undefined - shop
The shop where the webhook was triggered.
string - topic
The topic of the webhook.
Topics - webhookId
A unique ID for the webhook. Useful to keep track of which events your app has already processed.
string
JSONValue
string | number | boolean | null | JSONObject | JSONArrayJSONObject
- [x: string]
JSONValue
JSONArray
- __@iterator@410
Iterator
() => IterableIterator<JSONValue> - __@unscopables@412
Returns an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.
() => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; } - at
(index: number) => JSONValue - concat
Combines two or more arrays. This method returns a new array without modifying any existing arrays.
{ (...items: ConcatArray<JSONValue>[]): JSONValue[]; (...items: (JSONValue | ConcatArray<JSONValue>)[]): JSONValue[]; } - copyWithin
Returns the this object after copying a section of the array identified by start and end to the same array starting at position target
(target: number, start: number, end?: number) => JSONArray - entries
Returns an iterable of key, value pairs for every entry in the array
() => IterableIterator<[number, JSONValue]> - every
Determines whether all the members of an array satisfy the specified test.
{ <S extends JSONValue>(predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): boolean; } - fill
Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
(value: JSONValue, start?: number, end?: number) => JSONArray - filter
Returns the elements of an array that meet the condition specified in a callback function.
{ <S extends JSONValue>(predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): JSONValue[]; } - find
Returns the value of the first element in the array where predicate is true, and undefined otherwise.
{ <S extends JSONValue>(predicate: (this: void, value: JSONValue, index: number, obj: JSONValue[]) => value is S, thisArg?: any): S; (predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any): JSONValue; } - findIndex
Returns the index of the first element in the array where predicate is true, and -1 otherwise.
(predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any) => number - flat
Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.
<A, D extends number = 1>(this: A, depth?: D) => FlatArray<A, D>[] - flatMap
Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.
<U, This = undefined>(callback: (this: This, value: JSONValue, index: number, array: JSONValue[]) => U | readonly U[], thisArg?: This) => U[] - forEach
Performs the specified action for each element in an array.
(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => void, thisArg?: any) => void - includes
Determines whether an array includes a certain element, returning true or false as appropriate.
(searchElement: JSONValue, fromIndex?: number) => boolean - indexOf
Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
(searchElement: JSONValue, fromIndex?: number) => number - join
Adds all the elements of an array into a string, separated by the specified separator string.
(separator?: string) => string - keys
Returns an iterable of keys in the array
() => IterableIterator<number> - lastIndexOf
Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.
(searchElement: JSONValue, fromIndex?: number) => number - length
Gets or sets the length of the array. This is a number one higher than the highest index in the array.
number - map
Calls a defined callback function on each element of an array, and returns an array that contains the results.
<U>(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => U, thisArg?: any) => U[] - pop
Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
() => JSONValue - push
Appends new elements to the end of an array, and returns the new length of the array.
(...items: JSONValue[]) => number - reduce
Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; <U>(callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; } - reduceRight
Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; <U>(callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; } - reverse
Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.
() => JSONValue[] - shift
Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
() => JSONValue - slice
Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.
(start?: number, end?: number) => JSONValue[] - some
Determines whether the specified callback function returns true for any element of an array.
(predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any) => boolean - sort
Sorts an array in place. This method mutates the array and returns a reference to the same array.
(compareFn?: (a: JSONValue, b: JSONValue) => number) => JSONArray - splice
Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
{ (start: number, deleteCount?: number): JSONValue[]; (start: number, deleteCount: number, ...items: JSONValue[]): JSONValue[]; } - toLocaleString
Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
() => string - toString
Returns a string representation of an array.
() => string - unshift
Inserts new elements at the start of an array, and returns the new length of the array.
(...items: JSONValue[]) => number - values
Returns an iterable of values in the array
() => IterableIterator<JSONValue>
WebhookContextWithSession
- admin
An admin context for the webhook. Returned only if there is a session for the shop.
{ rest: RestClient & Resources; graphql: GraphqlClient; } - apiVersion
The API version used for the webhook.
string - payload
The payload from the webhook request.
JSONValue - session
A session with an offline token for the shop. Returned only if there is a session for the shop.
Session - shop
The shop where the webhook was triggered.
string - topic
The topic of the webhook.
Topics - webhookId
A unique ID for the webhook. Useful to keep track of which events your app has already processed.
string