The `clearbit` Node.js client (`clearbit-node`) provides an interface for interacting with various Clearbit business intelligence APIs, including Enrichment, Discovery, and Watchlist. It allows developers to programmatically look up person and company data by email or domain, and perform prospector searches. The library, last updated with version `1.3.5` eight years ago, primarily uses CommonJS modules and a Promise-based API for handling asynchronous operations and specific Clearbit API errors like `QueuedError` and `NotFoundError`. Due to its age and lack of maintenance, it does not natively support modern JavaScript features like ESM and may have unmaintained dependencies, making it potentially unsuitable for new projects or environments requiring up-to-date security patches. No new releases are expected.
npm install clearbitVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing the Clearbit client using an API key from environment variables, and performing basic lookups for a person by email and a company by domain, including specific error handling for Clearbit's `QueuedError` and `NotFoundError`.
Consider migrating to Clearbit's newer API versions directly via an HTTP client or seeking alternative, actively maintained libraries if available. Clearbit's API documentation should be consulted for direct integration options.
Ensure your project is configured for CommonJS, or use a bundler that can transpile CommonJS to ESM if necessary. For modern Node.js, stick to `require()` or use a different library.
Always use `instanceof` to catch specific Clearbit errors, as demonstrated in the quickstart. Be aware that the Promise implementation might not be fully compliant with modern Promise A+ specifications, which could lead to unexpected behavior in complex asynchronous flows.
Ensure `process.env.CLEARBIT_API_KEY` is set before the module is `require`d. For more dynamic scenarios, use `new Client({ key: 'api_key' })` after `const Client = require('clearbit').Client;` to instantiate with a runtime-provided key.Change your file to a CommonJS context (e.g., `.js` file without `type: 'module'`) or use a bundler that transpiles CJS. This package is CJS-only.
Ensure `require('clearbit')('YOUR_API_KEY')` has a valid key string, or when using `new Client({ key: 'YOUR_API_KEY' })`, that the `key` property is set.Ensure you are using `require('clearbit')(API_KEY)` for the initial factory function call, or `const Client = require('clearbit').Client; new Client({ key: API_KEY });` for the constructor.Always attach a `.catch()` block to your Promise chains or use `try...catch` with `async/await` to handle all possible errors, including Clearbit's custom error types.
No dependency data recorded yet.