Capítulo 419 de 988

Chapter 419: appRouterWebhook()

Core Idea

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

Key Concepts

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

Code Examples

export const POST = appRouterWebhook({
  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 const OPTIONS = POST;
  • What it demonstrates: Usage pattern for appRouterWebhook() from the official docs.

Key Takeaways

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

Connects To

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