Skip to content
← Back to Changelog

Friday, May 10th 2024

waitUntil is now available for Vercel Functions

Posted by

Avatar for kikobeats

Kiko Beats

Software Engineer, Infrastructure

Avatar for javivelasco

Javi Velasco

Software Engineer, Infrastructure

You can now use waitUntil by importing @vercel/functions in your Vercel Functions, regardless of the framework or runtime you use.

The waitUntil() method enqueues an asynchronous task to be performed during the lifecycle of the request. It doesn't block the response, but should complete before shutting down the function.

It's used to run anything that can be done after the response is sent, such as logging, sending analytics, or updating a cache, without blocking the response from being sent.

The package is supported in Next.js (including Server Actions), Vercel CLI, and other frameworks, and can be used with the Node.js and Edge runtimes.

Learn more in the documentation.