Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Hey guy's,
I currently have the customers/create webhook handler in Nest.Js working through the shopify cli with
shopify webhook trigger --topic customers/create --api-version 2023-07 --client-secret ${secret} --delivery-method http --address http://localhost:4110/shopify-webhooks
This would work for my testing use case but it comes with a default user with default data bob@biller.com. Is there a way to change this to another users data?
Otherwise, on to my manual approach to use Insomnia to manually create the webhook request.
Here is my HMAC generation code
export function shopifyHMAC({ hmac, secret }: any): string { return crypto.createHmac('sha256', hmac).update(JSON.stringify(secret), 'utf-8').digest('base64'); }
Here is my Insomnia attempts with the headers shown in the Shopify Docs.
Any help or guidance would be greatly appreciated.
Respectfully,
Thomas
Hi Thomas,
Trying to understand this issue a bit more - are you always seeing bob@biller.com appearing when the webhook fires, or only when a test webhook fires?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
I am seeing that for the test webhook. Is there a way to modify the payload for the test webhook? Or is there something I am missing for manually creating an HTTP payload through Insomnia?
For a test of the webhook - it will always be the default email address. You could run your own test by manually creating a "test" customer with the email you want, check the webhook, and then delete the test customer?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog