Registry / http-networking / zoominfo-api-auth-client

zoominfo-api-auth-client

JSON →
library1.0.1jsnpmunverified

The `zoominfo-api-auth-client` package provides an official client for authenticating with the Zoominfo API. It simplifies the process of obtaining access tokens required to interact with Zoominfo's various data services. Currently at version 1.0.1, this library offers two primary authentication flows: PKI (Public Key Infrastructure) using a client ID and private key, and basic authentication using a username and password. Unlike generic HTTP clients, it specifically handles the intricacies of Zoominfo's token generation endpoints, abstracting away the underlying OAuth 2.0 or proprietary authentication mechanisms. Its release cadence is not explicitly stated, but being at a `1.x.x` version, it's expected to be stable. Key differentiators include its direct integration with Zoominfo's specific authentication methods, reducing boilerplate for developers needing to access Zoominfo data without implementing custom authentication logic.

npm install zoominfo-api-auth-client
INSTALL
IMPORT
SIG · ZOOMINFO-API-AUTH-
Z
zoominfo-api-auth-client
http-networkingjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

authClient
const authClient = require('zoominfo-api-auth-client');
import authClient from 'zoominfo-api-auth-client';
The library primarily uses CommonJS `require`. Direct ES module `import` might not function as expected without transpilation or specific build configurations due to its CJS-centric design.
getAccessTokenViaPKI
const authClient = require('zoominfo-api-auth-client'); authClient.getAccessTokenViaPKI('username', 'clientId', 'privateKey');
import { getAccessTokenViaPKI } from 'zoominfo-api-auth-client';
Functions like `getAccessTokenViaPKI` are methods on the default exported object, not named exports. Access them via the `authClient` object.
getAccessTokenViaBasicAuth
const authClient = require('zoominfo-api-auth-client'); authClient.getAccessTokenViaBasicAuth('username', 'password');
import { getAccessTokenViaBasicAuth } from 'zoominfo-api-auth-client';
Similar to PKI authentication, this is a method on the `authClient` object. Direct named imports will result in a runtime error.

This quickstart demonstrates how to obtain an access token using the PKI authentication method, utilizing environment variables for secure credential handling and including basic error logging.

const authClient = require('zoominfo-api-auth-client'); const ZOOMINFO_USERNAME = process.env.ZOOMINFO_USERNAME ?? ''; const ZOOMINFO_CLIENT_ID = process.env.ZOOMINFO_CLIENT_ID ?? ''; const ZOOMINFO_PRIVATE_KEY = process.env.ZOOMINFO_PRIVATE_KEY ?? ''; async function authenticateAndGetToken() { if (!ZOOMINFO_USERNAME || !ZOOMINFO_CLIENT_ID || !ZOOMINFO_PRIVATE_KEY) { console.error('Missing ZoomInfo credentials in environment variables.'); process.exit(1); } try { console.log('Attempting to retrieve access token via PKI...'); const token = await authClient.getAccessTokenViaPKI(ZOOMINFO_USERNAME, ZOOMINFO_CLIENT_ID, ZOOMINFO_PRIVATE_KEY); console.log('Successfully obtained access token:'); console.log(token); // You can now use this token for subsequent Zoominfo API calls return token; } catch (error) { console.error('Failed to get access token:', error.message); // Log detailed error or handle specific Zoominfo API error codes here if (error.response && error.response.data) { console.error('API Error Details:', error.response.data); } process.exit(1); } } authenticateAndGetToken();
Debug
Known issues
gotchaThe library, at version 1.0.1, does not appear to expose functionality for automatically refreshing expired access tokens. Developers must implement their own logic to detect token expiration and request a new token before making subsequent API calls.
fix
Implement a token refresh mechanism in your application logic. Store the token and its expiration time, and request a new token when it's near expiration or when an API call returns an authentication error.
affects: >=1.0.0
gotchaSensitive credentials such as private keys, client IDs, usernames, and passwords should never be hardcoded in source files. They must be managed securely using environment variables, configuration services, or secret management tools.
fix
Store credentials in environment variables (e.g., `process.env.ZOOMINFO_PRIVATE_KEY`) or use a secrets management system. Access them at runtime, as demonstrated in the quickstart example.
affects: >=1.0.0
breakingThis library is currently at version 1.0.1. As a new major version, future updates (e.g., 2.0.0) might introduce breaking changes to method signatures, authentication flows, or error responses. Always review release notes for new major versions.
fix
Pin your dependency to the specific major version (e.g., `"zoominfo-api-auth-client": "^1.0.0"`) and carefully review release notes before upgrading to a new major version.
affects: <2.0.0
Errors
Common errors & fixes
TypeError: authClient.getAccessTokenViaPKI is not a function
Attempting to destructure `getAccessTokenViaPKI` directly from the `require` statement, or using ES module `import { getAccessTokenViaPKI } ...` when the library only exports a default object.
fix
Ensure you are using `const authClient = require('zoominfo-api-auth-client');` and then accessing the function as a method: `authClient.getAccessTokenViaPKI(...)`.
Error: Request failed with status code 401
Incorrect credentials (username, client ID, private key, or password) provided to the authentication functions, or the credentials have expired/been revoked.
fix
Double-check all authentication parameters for accuracy. Verify with Zoominfo support that your API credentials are valid and active. Ensure private key format is correct (e.g., not malformed).
Error: connect ECONNREFUSED <IP_ADDRESS>:<PORT>
The application could not establish a connection to the Zoominfo API authentication endpoint, likely due to network issues, firewall restrictions, or an incorrect API host configuration (though not exposed in this client).
fix
Verify your internet connectivity. Check any local or network firewall rules that might be blocking outbound connections to the Zoominfo API. If you suspect an issue with the Zoominfo service itself, check their status page.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
36 hits · last 30 days
node
28
OpenAI (training)
1
Resources
zoominfo-api-auth-client — npm install zoominfo-api-auth-client · libregistry