Skip to content

MaintenanceThe former company search endpoint goes into maintenance on November 9Migration guide

SDKs // TypeScript // Guides

Client options

Last verified

Configure the Reverse Contact TypeScript SDK client, override request options, inspect safe debug logs, and create a client with merged settings.

Pass ClientOptions to new ReverseContact() or client.withOptions() to configure your integration.

Constructor options

OptionDefaultMeaning
apiKeyRC_API_KEYYour API key
baseUrlRC_BASE_URL, then https://api.reversecontact.comAPI origin
timeout90_000Milliseconds per HTTP attempt
maxRetries4Retries after the first attempt
defaultHeadersnoneHeaders added to every request
fetchthe global fetchA custom Fetch implementation, for a proxy or for tests
appInfononeYour integration's { name, version?, url? }. Name and version are added to the User-Agent
logLeveloff, or debug when RC_LOG=debugLogs each attempt to console.debug
dangerouslyAllowBrowserfalseAllows the client in a browser, exposing your key

Debug logs show the method, path, status, attempt, retry delay and request id. They never show the API key, headers, query or body.

Use client.withOptions() to create a new client with merged options. The original client stays unchanged:

TypeScript SDK

Client options

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

const client = new ReverseContact({
  apiKey: process.env.RC_API_KEY,
  timeout: 120_000,
  maxRetries: 2,
  appInfo: { name: "my-crm-sync", version: "1.4.0" }
});

const debugClient = client.withOptions({ logLevel: "debug" });
await debugClient.usage.retrieve();

The package also exports API types: Person, Company, EnrichPersonParams, SearchPeopleParams, SearchOrganizationsParams, JobStatus and Quotas. Use Body<'operationId'> and Data<'operationId'> for any operation.

Per-request options

RequestOptions accepts timeout, maxRetries, headers and signal. IdempotentRequestOptions adds idempotencyKey for contact lookups, List creation and Bulk submission. Put request options last, after path ids and any body or query parameters. For methods with optional query parameters, pass {} before the options when no filter is needed.

timeout must be positive and finite. maxRetries must be a nonnegative integer. Invalid values raise ReverseContactError. See Timeouts and cancellation for wait options and Errors and retries for retry rules.

The baseUrl can include a gateway prefix. SDK routes already include /v2.

The SDK accepts appInfo.url, but adds only the name and version to the User-Agent. VERSION exports the package version. After merging client and request headers, the SDK removes the reserved X-Request-Origin header.

Return to the TypeScript SDK overview.

FAQ

How do I override SDK options for one request?

Pass RequestOptions as the last argument, after any ids and body or query parameters. The options include timeout, maxRetries, headers and signal.

Does client.withOptions change the original client?

client.withOptions() creates a new client with merged options and headers. The original client remains unchanged.

Does SDK debug logging include API keys or request bodies?

Debug logs contain method, path, status, attempt, retry delay and request id. Debug logs exclude API keys, headers, query parameters and request bodies.