How to use the @shopify/koa-shopify-auth.verifyRequest function in @shopify/koa-shopify-auth

To help you get started, we’ve selected a few @shopify/koa-shopify-auth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Shopify / shopify-demo-app-node-react / server.js View on Github external
console.log('Failed to register webhook', registration.result);
        }
        await getSubscriptionUrl(ctx, accessToken, shop);
      }
    })
  );

  const webhook = receiveWebhook({ secret: SHOPIFY_API_SECRET_KEY });

  router.post('/webhooks/products/create', webhook, (ctx) => {
    console.log('received webhook: ', ctx.state.webhook);
  });

  server.use(graphQLProxy({ version: ApiVersion.April19 }));

  router.get('*', verifyRequest(), async (ctx) => {
    await handle(ctx.req, ctx.res);
    ctx.respond = false;
    ctx.res.statusCode = 200;
  });

  server.use(router.allowedMethods());
  server.use(router.routes());

  server.listen(port, () => {
    console.log(`> Ready on http://localhost:${port}`);
  });
});

@shopify/koa-shopify-auth

Middleware to authenticate a Koa application with Shopify

MIT
Latest version published 2 years ago

Package Health Score

47 / 100
Full package analysis

Similar packages