SDKs overview
Checkr provides Software Development Kits (SDKs) to facilitate the integration of its background check services into various applications. These SDKs abstract the underlying RESTful API, offering language-specific methods and objects that simplify common tasks such as creating candidates, initiating background checks, and retrieving report statuses. Developers can utilize these official libraries to streamline their development process, reduce boilerplate code, and ensure adherence to API best practices.
The Checkr API itself is a RESTful interface that operates over HTTPS and uses JSON for request and response bodies. It adheres to standard HTTP methods (GET, POST, PUT, DELETE) and status codes (such as 200 OK, 201 Created, 400 Bad Request, 401 Unauthorized, 404 Not Found, 500 Internal Server Error) for communication. Authentication for API requests is typically handled via an API key, which must be included in the Authorization header of each request. For detailed information on the API endpoints and data structures, refer to the Checkr API reference documentation.
Checkr also provides a sandbox environment for testing integrations without affecting live data or incurring charges. This allows developers to thoroughly test their implementations before deploying to production. Additionally, Checkr supports webhooks, which enable applications to receive real-time notifications about changes in background check statuses, rather than constantly polling the API for updates. This asynchronous communication pattern is a common practice in modern web applications for improving efficiency and responsiveness, as detailed in Mozilla's webhook explanation.
Official SDKs by language
Checkr offers official SDKs for several popular programming languages, designed to simplify interaction with their API. These SDKs are maintained by Checkr and provide a consistent interface across different environments. The table below outlines the currently available official SDKs, their respective package names, installation commands, and maturity status.
| Language | Package Name | Installation Command | Maturity |
|---|---|---|---|
| Node.js | checkr |
npm install checkr or yarn add checkr |
Stable |
| Ruby | checkr |
gem install checkr |
Stable |
| Python | checkr |
pip install checkr |
Stable |
| PHP | checkr/checkr-php |
composer require checkr/checkr-php |
Stable |
| Java | com.checkr:checkr-java |
Add to pom.xml (Maven) or build.gradle (Gradle) |
Stable |
For specific versioning and detailed usage instructions, developers should consult the official Checkr SDK documentation.
Installation
Installing Checkr SDKs typically involves using the standard package manager for the respective programming language. Below are detailed instructions for each official SDK. Before installation, ensure you have the correct language runtime and package manager set up in your development environment.
Node.js
To install the Node.js SDK, use npm or Yarn:
npm install checkr
# or
yarn add checkr
Ruby
To install the Ruby SDK, use RubyGems:
gem install checkr
Python
To install the Python SDK, use pip:
pip install checkr
PHP
To install the PHP SDK, use Composer:
composer require checkr/checkr-php
Java
For Java, you typically add the dependency to your project's build file. For Maven, add the following to your pom.xml:
<dependency>
<groupId>com.checkr</groupId>
<artifactId>checkr-java</artifactId>
<version>[latest_version]</version>
</dependency>
For Gradle, add the following to your build.gradle:
implementation 'com.checkr:checkr-java:[latest_version]'
Replace [latest_version] with the most recent stable version available, which can be found in the Checkr Java SDK documentation.
Quickstart example
This example demonstrates how to create a candidate and initiate a background check using the Node.js SDK. This snippet assumes you have already installed the Checkr Node.js SDK and have your API key ready. Remember to replace 'YOUR_API_KEY' with your actual Checkr API key.
const Checkr = require('checkr');
// Initialize the Checkr client with your API key
const checkr = new Checkr('YOUR_API_KEY');
async function createCandidateAndReport() {
try {
// 1. Create a new candidate
const candidate = await checkr.candidates.create({
first_name: 'Jane',
last_name: 'Doe',
email: '[email protected]',
phone: '+14155551234',
dob: '1990-01-01',
ssn: '000-00-0000', // For testing, use a test SSN or omit for some report types
zipcode: '94103'
});
console.log('Candidate created:', candidate.id);
// 2. Create a background report for the candidate
// 'essential' is an example package. Refer to Checkr docs for available packages.
const report = await checkr.reports.create({
candidate_id: candidate.id,
package: 'essential',
// You can specify other report parameters here, e.g., 'driver_license'
});
console.log('Report initiated:', report.id);
console.log('Report status:', report.status);
} catch (error) {
console.error('Error:', error.message);
if (error.response) {
console.error('API Error Response:', error.response.data);
}
}
}
createCandidateAndReport();
This example performs two primary actions:
- Candidate Creation: It uses
checkr.candidates.create()to register a new candidate with basic personal information. The response includes the uniquecandidate.id, which is essential for initiating a background check. - Report Initiation: It then uses
checkr.reports.create(), passing thecandidate_idand specifying a background check package (e.g.,'essential'). The returnedreportobject contains thereport.idand its initialstatus.
For a complete list of available report packages and their requirements, consult the Checkr background check packages documentation. The ssn field is sensitive and should be handled securely; for testing, Checkr provides specific test SSNs that trigger various outcomes without using real data.
Community libraries
While Checkr provides official SDKs for the most common languages, the broader developer community may also contribute libraries or wrappers for other languages or specific frameworks. These community-contributed tools are not officially supported or maintained by Checkr, meaning their reliability, security, and feature completeness can vary. Developers considering community libraries should:
- Review the source code: Examine the project's repository for code quality, security practices, and active maintenance.
- Check documentation and examples: Ensure adequate documentation is available for proper usage and understanding.
- Assess community activity: Look for recent commits, issue resolution, and an active contributor base.
- Verify license: Understand the licensing terms under which the library is distributed.
As of this writing, specific widely adopted community libraries for Checkr beyond the official SDKs are not prominently documented. Developers seeking integrations in languages not covered by official SDKs, or requiring highly specialized functionality, might explore general-purpose HTTP client libraries (e.g., axios for JavaScript, requests for Python, Guzzle for PHP) to interact directly with the Checkr REST API. This approach offers maximum flexibility but requires manual handling of authentication, request construction, and response parsing, which the official SDKs automate.