Skip to content

TypeScript and JavaScript SDK

Use the Reverse Contact TypeScript and JavaScript SDK to enrich profiles, search within a budget, find contacts, and manage Lists and async tasks.

Introduction

@reverse-contact/sdk is the official TypeScript and JavaScript client for the Reverse Contact API. It covers every endpoint with typed requests and results. The client handles safe retries, waits for asynchronous tasks, and pages through search results within a budget you set. It has no runtime dependencies.

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

These guides describe the published SDK version 0.4.1. The Python SDK is also available for Python 3.11 and later. Keep API keys on your server: browser construction is rejected by default.

Install

npm

Install

npm install @reverse-contact/sdk

First call

Set RC_API_KEY on your server, then run this example. A successful person enrichment costs 2 credits. A lookup with no match is free.

TypeScript SDK

First call

import ReverseContact from "@reverse-contact/sdk";

const client = new ReverseContact();
const result = await client.enrich.person({ email: "jane.doe@acme.com" });
console.log(result?.data.person ?? "No confident match");

Endpoints and methods

EndpointMethod
Enrich profileclient.enrich.person()
Enrich companyclient.enrich.company()
Person profileclient.fetch.person()
Person profile liveclient.fetch.personLive()
Person profile statusclient.fetch.checkPerson()
Company profileclient.fetch.company()
Company profile liveclient.fetch.companyLive()
Company profile statusclient.fetch.checkCompany()
People searchclient.search.people(), client.search.iterPeople()
Agentic Searchclient.search.peopleByPrompt(), client.search.iterPeopleByPrompt()
People lookalikeclient.search.peopleLookalike(), client.search.iterPeopleLookalike()
People search countclient.search.countPeople()
Search autocomplete for your productclient.search.peopleAutoCompletionFields()
People search available fieldsclient.search.peopleFields()
Company searchclient.search.organizations(), client.search.iterOrganizations()
Agentic Company Searchclient.search.organizationsByPrompt(), client.search.iterOrganizationsByPrompt()
Company search countclient.search.countOrganizations()
Company search available fieldsclient.search.organizationsFields()
Find Emailclient.contact.findEmail()
Verify Emailclient.contact.verifyEmail()
Find Phoneclient.contact.findPhone()
All Listsclient.lists.list(), client.lists.listAll()
Create a Listclient.lists.create()
Get a Listclient.lists.retrieve()
Delete a Listclient.lists.delete()
List membersclient.lists.members.list(), client.lists.members.listAll()
Add membersclient.lists.members.add()
Remove membersclient.lists.members.remove()
Import members and dataclient.lists.importSignals()
Read a List operationclient.lists.operations.retrieve(), client.lists.operations.wait()
Cancel a List operationclient.lists.operations.cancel()
Export a Listclient.lists.export()
Bulkclient.bulk.enrichPersons()
Task historyclient.bulk.list(), client.bulk.listAll()
Get a taskclient.bulk.retrieve(), client.bulk.wait()
Download task resultsclient.bulk.results()
Read task results by pageclient.bulk.rows(), client.bulk.iterateRows()
Cancel a taskclient.bulk.cancel()
Polling a taskclient.tasks.retrieve(), client.tasks.wait()
Usageclient.usage.retrieve()

Look for the TypeScript SDK tab in endpoint code examples. For now, the List and Bulk examples are in Lists and Bulk. Request fields use the API's camelCase names.

Where to go next

API key

Keep the key on your server and pass apiKey, or let the client read RC_API_KEY. See Install and configure.

Lookups that find nothing

Check for null when a lookup finds no profile. See First call for response handling.

Async tasks: live fetch, Find Email and Find Phone

Use task.wait() to poll for free, for up to 30 minutes by default. A failed task raises TaskFailedError. Save task.id to resume with client.tasks.wait() after a restart. See Async tasks.

Webhook delivery instead of polling

Receive results at an HTTPS webhook and parse deliveries in Async tasks.

Lists and Bulk

Use Lists and Bulk to create Lists, track imports, and read Bulk results as they come or download them.

Search within a budget

Count for free, then use the required maxResults iterator option to cap requested results. See Search within a budget.

Filter values as constants

Use Filter values as constants to autocomplete supported values in your editor.

Errors and retries

The SDK retries per-minute limits and HTTP 500, 502, 503 and 504 up to 4 times. Daily limits, key credit limits and missing credits are not retried. Read Errors and retries.

Safe retries on Find Email and Find Phone

Contact lookups reuse an idempotency key across retries, including HTTP 409 IDEMPOTENCY_KEY_IN_USE. Outside per-minute rate limits, other 4xx errors are not retried. Read Errors and retries.

Timeouts and cancellation

See Timeouts and cancellation to set a timeout for each HTTP attempt or cancel local requests.

Client options

Set transport, logging, headers and per-request overrides with Client options.

Without the SDK

To call the API with an HTTP client or generate one from OpenAPI, see Without the SDK.

FAQ

Is there an official Reverse Contact SDK?

Yes. Reverse Contact publishes @reverse-contact/sdk on npm for TypeScript and JavaScript, and reversecontact on PyPI for Python 3.11 and later. The TypeScript and JavaScript SDK runs on Node.js 22 and later, Bun, Deno and edge runtimes. Both SDKs cover every API endpoint, handle safe retries, and wait for asynchronous tasks.

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

No. Anyone can read an API key shipped in front-end code, so the @reverse-contact/sdk client throws when it is created in a browser. Call Reverse Contact from your server, keep the key in the RC_API_KEY environment variable, and send the browser only what it needs.

Does @reverse-contact/sdk retry failed requests?

Yes. @reverse-contact/sdk retries per-minute rate limits and 500, 502, 503 and 504 errors up to 4 times, after the delay the API asks for or with exponential backoff. It never retries daily limits, API key credit limits, missing credits or any other 4xx error except 409 IDEMPOTENCY_KEY_IN_USE.

How do I cap the credits a Reverse Contact search spends?

Call a free count method first, such as client.search.countPeople(). Then read results with a search iterator such as client.search.iterPeople(). The required maxResults option caps the number of profiles requested and billed.

How do I wait for a live fetch or Find Email result with the SDK?

Call task.wait() on the task that client.fetch.personLive() or client.contact.findEmail() returns. It polls for free until the task ends, 30 minutes at most by default, and raises TaskFailedError when the task fails. Save task.id first, to resume with client.tasks.wait() after a restart.

Last verified