@beforequery/sdk is the official TypeScript SDK. It works in browsers (public key), React Native, and Node.js v18+ (client credentials), with WebSocket transport by default and automatic SSE fallback.

Install

Browser — streaming chat

Node.js — server-side

Scoping retrieval

Restrict answers to specific source groups (e.g. a docs version):

Transport

A single WebSocket connection is reused across sequential chat() calls, with a 5-second connect timeout before falling back to SSE in auto mode.

Local testing

See the full @beforequery/sdk reference for React Native polyfills, all options, and error handling.