@s2-dev/resumable-stream npm package.
This is inspired by Vercel’s take on stream resumption.
Prerequisites
-
Sign up here, generate an access token and set it as
S2_ACCESS_TOKENin your env. -
Create a new basin from the Basins tab with the Create Stream on Append option enabled, and set it as
S2_BASINin your env.
S2_BATCH_SIZE.
Ingegrating with the Chat SDK
Import the Package
route.ts
Stream Creation
route.ts
Stream Resumption
route.ts

