JavaScript SDK logo
Embed & Developer

JavaScript SDK

Framework-agnostic SDK for any JavaScript environment

What is JavaScript SDK?

The @kelu/sdk package is the core Kelu client library. It works in any JavaScript environment: browser, Node.js, React Native, Deno, and edge runtimes. The React package is built on top of this SDK. Use it directly when you need maximum control or when your stack is not React-based.

Integration

How Kelu works with JavaScript SDK

Everything you can do once the integration is connected.

Universal environment support

Works in browser, Node.js, React Native, and edge runtimes (Cloudflare Workers, Deno Deploy, Vercel Edge). One package, all environments.

Search and Chat APIs

The SDK wraps Kelu's search (hybrid vector + full-text) and chat (SSE streaming RAG) endpoints with a clean, typed API.

Public and server-side auth

Use public client keys (kl_pk_...) for browser-side code and client ID + secret (kl_ci_... / kl_cs_...) for server-side integrations.

Streaming response support

The SDK handles SSE stream parsing and provides an async iterator for streaming chat responses in any JavaScript environment.

Setup

How to set it up

1

Install: npm install @kelu/sdk

2

Initialize the client with your client key: const kelu = new KeluClient({ clientKey: 'kl_pk_...' })

3

Call kelu.chat() for streaming RAG answers or kelu.search() for hybrid search results.

JavaScript SDK — Frequently Asked Questions

Common questions about connecting Kelu to JavaScript SDK.

Yes. @kelu/sdk is built to run in edge runtimes including Cloudflare Workers, Vercel Edge Functions, and Deno Deploy. It uses the standard Fetch API and avoids Node.js-specific APIs, making it compatible with any edge runtime that supports Fetch.
Install @kelu/sdk and initialize a KeluClient with your knowledge base's client key. Call kelu.chat() for streaming RAG answers or kelu.search() for hybrid search results. The SDK is framework-agnostic — you manage the UI reactive state using your framework's primitives (Vue refs, Svelte stores, etc.).
The SDK parses Server-Sent Events (SSE) from the Kelu Chat API and exposes an async iterator. You iterate over the stream to receive token chunks in real time and assemble the final answer with citations when the stream closes.
Public client keys (kl_pk_...) are for browser-side and client-side use — they grant read-only access and are safe to expose in public pages. Client ID plus secret (kl_ci_... / kl_cs_...) pairs are for server-side integrations where the secret must never be exposed to the browser.
@kelu/sdk is the core client library. @kelu/react is a React wrapper built on top of it that provides the <KeluChat /> component and useKeluChat hook. If you are building a React app, prefer @kelu/react. For Vue, Svelte, React Native, Node.js, or raw API access, use @kelu/sdk directly.

Ready to connect JavaScript SDK?

Start free. No credit card required. Connect your first integration in under 5 minutes.