Saving Webhook payload to state or global variable

New Member
9 0 0

We setup basic shopify Node/React app and registered the orders/create webhook. How can save the payload to a global variable or state and how do we access it in the app? We want to trigger a function when we recieve the webhook. Any help is appreciated.


const ordersCreate = await Shopify.Webhooks.Registry.register({
          path: "/webhooks",
          topic: "ORDERS_CREATE",
          webhookHandler: async (topic, shop, body) =>

//process the webhoooks"/webhooks", async (ctx) => {
    try {
      await Shopify.Webhooks.Registry.process(ctx.req, ctx.res);
      console.log(`Webhook processed, returned status code 200`);
    } catch (error) {
      console.log(`Failed to process webhook: ${error}`);


Replies 0 (0)