Node SDK
on
Subscribe to ready, update, error and stream state events.
ready fires with the version of the first snapshot; update with the version of every snapshot it accepts, the first one included; error with each fetch, key or snapshot error; streamStateChange with up or down when the optional SSE stream connects or drops.
Returns the client, so calls chain.
on(event: 'ready' | 'update' | 'error' | 'streamStateChange', fn): thisflags.on('update', (snapshotVersion) => console.log('flags at', snapshotVersion));
flags.on('error', (err) => console.warn(err.message));The SDK is @rollkit/sdk in the repository (packages/sdk). It is for server-side Node; browsers use a client key with the delivery API.