Vercel Sandbox added three session webhooks on November 30. A backend can listen for a session becoming ready, nearing its timeout or stopping. An app that starts sandboxes to run tasks can use those events to show the current state in its interface and start any cleanup it needs when a session ends.

The timeout warning gives the app time to act

Vercel sends the expiring event a minute before the timeout by default. Developers can configure the lead time, and extending the session schedules a fresh warning before the new deadline. For a task that is still running, the warning gives the app a chance to decide whether to extend the session or keep the original deadline.

Teams subscribe in Vercel’s webhook settings. The three event names end in started, expiring and stopped. The payload identifies the sandbox and session. A stopped event also includes the reason it ended, its duration, active CPU time and network transfer. Vercel says an event can arrive more than once, so a receiver that records the stop or starts cleanup should handle repeat deliveries without repeating the action.

Sources

Vercel changelog, November 30 · Vercel webhooks documentation

Stay curious. Choose thoughtfully.More news