---
title: "Version 1.3.0 adds withFlush() for serverless handlers and takes the flush interval in seconds"
canonical: https://www.togohq.ai/changelog/sdk-node/1.3.0
package: "@togohq/sdk-node"
version: "1.3.0"
released: 2026-11-05T18:38:05.416Z
published: 2026-11-05T00:00:00Z
breaking: true
---

# @togohq/sdk-node 1.3.0 — Version 1.3.0 adds withFlush() for serverless handlers and takes the flush interval in seconds

Released November 5, 2026 · Node.js SDK
Permalink: https://www.togohq.ai/changelog/sdk-node/1.3.0

## Breaking

- `flushIntervalSeconds` (10 to 60, default 10) replaces `flushIntervalMs`. A `flushIntervalMs` passed to `init()` is ignored, with a warning naming the replacement.

## New

- `withFlush(handler)` wraps a serverless handler so the queue is sent after it returns or throws, with its result passed through unchanged.

## Improved

- `batchSize` accepts 100 to 500. A value outside that range is moved into it, with a warning.
- `flush()` retries a network failure or a server error within a 2-second budget before it resolves, and never retries a `429`.

## Migration

Replace `flushIntervalMs` with `flushIntervalSeconds`, and wrap serverless handlers in `withFlush()`.

Before:

```ts
const analytics = init({ writeKey, flushIntervalMs: 10_000 });
```

After:

```ts
const analytics = init({ writeKey, flushIntervalSeconds: 10 });
export const handler = analytics.withFlush(async (event) => {
  analytics.track('order_paid', {}, { userId: event.userId });
});
```

The old form stops working in @togohq/sdk-node 1.3.0.
