> Reverse Contact API documentation. This is the Markdown copy of https://docs.reversecontact.com/sdk/javascript/install
> Every page is listed at https://docs.reversecontact.com/llms.txt, every endpoint with its credit cost and status at https://docs.reversecontact.com/catalog.json

# Install and configure

> Install the Reverse Contact TypeScript SDK on Node.js, Bun, Deno or edge runtimes, configure your API key, and create a server-side client.

- Last verified: 2026-11-04

Install `@reverse-contact/sdk` and keep your API key in your server environment. These guides cover the published package version 0.3.0.

## Install

**Install**

```bash [npm]
npm install @reverse-contact/sdk
```
```bash [pnpm]
pnpm add @reverse-contact/sdk
```
```bash [Yarn]
yarn add @reverse-contact/sdk
```
```bash [Bun]
bun add @reverse-contact/sdk
```
```bash [Deno]
deno add npm:@reverse-contact/sdk
```

On Deno, run your script with `--allow-net`. Add `--allow-env` if you read the key from the environment.

## Runtime requirements

The SDK runs on Node.js 22 and later, Bun, Deno, and edge runtimes that provide the standard Fetch API, `AbortController` and `crypto.randomUUID`. The package ships as ESM and CommonJS and has no runtime dependencies.

## API key

Pass your API key with the `apiKey` option, or omit the option to let the client read `RC_API_KEY`. These guides use that environment variable, but you can use any server-side source, such as a secret manager. If you serve several workspaces, create one client per key.

Keep the key on your server. Anyone can read a key shipped in front-end code, so the constructor throws when it runs in a browser. Setting `dangerouslyAllowBrowser: true` bypasses that check and exposes your key to every visitor. See [Authentication](https://docs.reversecontact.com/authentication) to create a key.

**API key**

```bash [Terminal]
export RC_API_KEY="your-api-key"
```

## Create a client

**Create a client**

```typescript [TypeScript SDK]
import ReverseContact from "@reverse-contact/sdk";
// CommonJS: const { ReverseContact } = require("@reverse-contact/sdk");

const client = new ReverseContact({ apiKey: process.env.RC_API_KEY });
const usage = await client.usage.retrieve();
console.log("Credits left:", usage.quotas?.workspace.credits.left);
```

`new ReverseContact()` also reads `RC_API_KEY` automatically. The constructor raises `ReverseContactError` when no key is available. See [Client options](https://docs.reversecontact.com/sdk/javascript/client-options) for configuration and [First call](https://docs.reversecontact.com/sdk/javascript/first-call) for enrichment.

Return to the [TypeScript SDK overview](https://docs.reversecontact.com/sdk/javascript).

## FAQ

### Which runtimes support the Reverse Contact TypeScript SDK?

`@reverse-contact/sdk` supports Node.js 22 and later, Bun, Deno, and edge runtimes with the standard Fetch API, `AbortController` and `crypto.randomUUID`.

### Which environment variable does the SDK use for the API key?

`new ReverseContact()` reads `RC_API_KEY` when the `apiKey` constructor option is omitted. An explicit `apiKey` can come from any server-side secret source.

### Can I use @reverse-contact/sdk in the browser?

The SDK constructor rejects browsers by default. Setting `dangerouslyAllowBrowser: true` bypasses that check and exposes the key to visitors. Keep the SDK client on your server.
