Skip to content

checkhim/js-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CheckHim SDK

npm version

NPM package: https://www.npmjs.com/package/checkhim

Official Node.js SDK for phone number verification via checkhim.tech.

Installation

npm install checkhim

Usage

import CheckHim from 'checkhim';

const client = new CheckHim('ch_test_your_api_key');

async function run() {
  try {
    const result = await client.verify({ number: '+5511984339000' });
    console.log('Valid:', result.valid, '| Carrier:', result.carrier);
  } catch (e) {
    console.error('Verification failed:', e.message, e.code);
  }
}

run();

Error Handling

If the API returns an error, it will be thrown as an exception with a message and a code property. Example:

{
  "error": "verification failed: Network is forbidden (code: 6)",
  "code": "REJECTED_NETWORK"
}

Contributing

We welcome contributions from the community! To contribute:

  1. Fork this repository and create your branch from main.
  2. Install dependencies with npm install.
  3. Write clear, well-documented code and add tests for new features or bug fixes.
  4. Ensure all tests pass with npx jest.
  5. Open a pull request with a clear description of your changes and reference any related issues.

For major changes, please open an issue first to discuss what you would like to change.

By contributing, you agree to abide by the Code of Conduct and the project's license.

License

MIT

About

Library for Javascript

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published