Options for the Next.js wrapper
Optional
Next.js 15+ after() function from 'next/server' Preferred method - runs after response without blocking
import { after } from 'next/server';export const POST = withObserve(handler, { after }); Copy
import { after } from 'next/server';export const POST = withObserve(handler, { after });
Vercel's waitUntil() from '@vercel/functions' Alternative for Vercel deployments
import { waitUntil } from '@vercel/functions';export const POST = withObserve(handler, { waitUntil }); Copy
import { waitUntil } from '@vercel/functions';export const POST = withObserve(handler, { waitUntil });
Options for the Next.js wrapper