Create serverless, event-driven Next.js applications that respond to Postgres changes.
app/api/hello/route.ts
with the following code:.env.local
file in your project root and add:SEQUIN_WEBHOOK_SECRET
environment variable. You will need to use this secret value in the Sequin dashboard when you create the webhook sink.SEQUIN_WEBHOOK_SECRET
environment variable with the same value you used locally.local_endpoint
) and flip the “Use localhost” switch. Follow the instructions in the Sequin console to install the Sequin CLI, then run:Authorization
and the value to Bearer SEQUIN_WEBHOOK_SECRET
using the secret value you created above.public.users
or public
).30000 ms
for “Request timeout” as this is more than enough time for your function to process the request1
for “Batch size” since you’re just logging messagesAuthorization
and the value Bearer SEQUIN_WEBHOOK_SECRET
, using the secret value you set in your Lambda function’s environment variables.users_webhook_sink
) and click “Create Webhook Sink”.npm run dev
sequin tunnel --ports=3000:local_endpoint
200
response in your Next.js app:SEQUIN_WEBHOOK_SECRET
.env.local
file)