---
title: featurebase-js | Featurebase
description: Typed client SDK for the Featurebase Messenger. Install, boot, and start chatting with users in four lines.
---

`featurebase-js` is the typed JavaScript wrapper for the Featurebase Messenger. It auto-loads the runtime, exposes every messenger action as a regular function with TypeScript types, and works in any browser environment — React, Vue, Svelte, Angular, or plain HTML.

## Install

Terminal window

```
npm  install featurebase-js
pnpm add     featurebase-js
yarn add     featurebase-js
```

## Quickstart

```
import Featurebase from 'featurebase-js';


Featurebase({
  appId: 'org_your_id',
  userId: user.id,
  email: user.email,
  userHash: user.featurebaseHash, // recommended (HMAC-SHA256 of userId)
});
```

That’s it. The runtime script is auto-injected on first call, the messenger launcher mounts in the corner, and you can call any action below from anywhere in your app.

## What you get

- **Named exports** for every messenger action — `show`, `hide`, `showArticle`, `showConversation`, `setTheme`, `onUnreadCountChange`, …
- **TypeScript-first.** `FeaturebaseSettings` is fully typed; unknown attributes are forwarded verbatim to the contact’s profile.
- **SSR-safe.** Every export is a no-op when `window` is undefined; safe to import in Next.js server components, Remix loaders, etc.
- **Boot-or-update.** The default `Featurebase()` call routes to `boot` on first invocation and `identify` on subsequent ones, so calling it inside React effects or page transitions never reboots the messenger.
- **React helper** at `featurebase-js/react` — `<FeaturebaseProvider>` and `useFeaturebase()` for declarative usage.
- **Tiny bundle.** \~7 KB minified. Zero runtime dependencies.

## Next steps

- [API reference](/guides/featurebase-js/api-reference/index.md) — every method, signature, and example.
- [Framework examples](/guides/featurebase-js/frameworks/index.md) — React, Vue, Svelte, Angular, and plain HTML.
- [React helper](/guides/featurebase-js/react/index.md) — `<FeaturebaseProvider>` and `useFeaturebase()`.
