Capítulo 486 de 988

Chapter 486: pagesRouterWebhook()

Core Idea

Simplifies the process of setting up a Lambda Webhook in your Next. js app which is using Pages Router.

Key Concepts

  • API
  • secret
  • testing
  • extraHeaders
  • onSuccess()
  • onError()
  • onTimeout()
  • Example

Code Examples

const handler = pagesRouterWebhook({
  secret: 'mysecret',
  testing: true,
  extraHeaders: {
    region: 'south-asia',
  },
  onSuccess: () => console.log('Rendering Completed Successfully'),
  onError: () => console.log('Something went wrong while rendering'),
  onTimeout: () => console.log('Timeout occurred while rendering'),
});
export default handler;
  • What it demonstrates: Usage pattern for pagesRouterWebhook() from the official docs.

Key Takeaways

  1. Understand api when working with pagesRouterWebhook().
  2. Understand secret when working with pagesRouterWebhook().
  3. Understand testing when working with pagesRouterWebhook().
  4. Understand extraheaders when working with pagesRouterWebhook().
  5. Understand onsuccess() when working with pagesRouterWebhook().

Connects To

  • api: related page in the Lambda (@remotion/lambda) section.
  • Approuterwebhook: related page in the Lambda (@remotion/lambda) section.
  • Authentication: related page in the Lambda (@remotion/lambda) section.