SDKs overview
Trulioo offers Software Development Kits (SDKs) to facilitate the integration of its identity verification services into various applications. These SDKs are designed to abstract the direct consumption of Trulioo's RESTful API, providing developers with language-specific client libraries that simplify common tasks such as submitting verification requests, handling responses, and managing authentication. The availability of SDKs for popular programming languages aims to reduce development time and potential errors associated with manual API client construction. Developers can find Trulioo's comprehensive developer documentation on their dedicated portal, which includes API references, guides, and SDK usage instructions.
The SDKs are built to interact with Trulioo's GlobalGateway platform, which underpins services like Identity Document Verification, Business Verification, and Watchlist Screening. By using an SDK, developers can focus on their application logic rather than the intricacies of HTTP requests, JSON parsing, and error handling for the Trulioo API. The Trulioo platform typically returns verification results in JSON format, which the SDKs can help parse into native language objects, enhancing developer experience.
Official SDKs by language
Trulioo provides official SDKs for several widely used programming languages, ensuring broad compatibility for development teams. These SDKs are maintained by Trulioo and are the recommended method for integrating with the platform. They are typically available through standard package managers for each language, simplifying dependency management and updates. Each SDK is designed to reflect the structure and capabilities of the underlying Trulioo API reference, offering methods that correspond to API endpoints.
The following table outlines the officially supported SDKs, their respective package names, and typical installation commands:
| Language | Package Name | Install Command (Example) | Maturity |
|---|---|---|---|
| Python | trulioo-python-sdk |
pip install trulioo-python-sdk |
Stable |
| Java | com.trulioo:trulioo-java-sdk |
Maven: Add dependency in pom.xmlGradle: Add dependency in build.gradle |
Stable |
| Node.js | @trulioo/trulioo-node-sdk |
npm install @trulioo/trulioo-node-sdk |
Stable |
| .NET (C#) | Trulioo.Client |
dotnet add package Trulioo.Client |
Stable |
Each SDK provides a client object that developers instantiate with their API credentials. This client then exposes methods for interacting with various Trulioo services, such as submitting a verification request for an individual or a business. The SDKs typically handle the serialization of request bodies into JSON and deserialization of JSON responses back into native language objects, reducing boilerplate code.
Installation
Installation of Trulioo SDKs follows standard procedures for each programming ecosystem. Developers should consult the official Trulioo developer documentation for the most current and detailed installation instructions, as package versions and prerequisites may evolve. Proper installation ensures that all necessary dependencies are resolved and the SDK can be imported and utilized within a project.
Python
For Python projects, the SDK is distributed via PyPI (Python Package Index). Installation is performed using pip, the standard package installer for Python:
pip install trulioo-python-sdk
It is generally recommended to install packages within a Python virtual environment to manage dependencies for specific projects without affecting the global Python installation. Instructions for setting up virtual environments are widely available, for example, on the Python documentation for venv.
Java
The Java SDK is available through Maven Central. Developers using Maven or Gradle can add the appropriate dependency to their project's build file. For Maven, this involves adding an entry to the dependencies section of the pom.xml file:
<dependency>
<groupId>com.trulioo</groupId>
<artifactId>trulioo-java-sdk</artifactId>
<version>[latest_version]</version>
</dependency>
Replace [latest_version] with the most recent version number found in the Trulioo Java SDK documentation. For Gradle, the dependency is added to the build.gradle file's dependencies block:
implementation 'com.trulioo:trulioo-java-sdk:[latest_version]'
Node.js
The Node.js SDK is published on the npm registry. Installation is straightforward using the npm command-line tool:
npm install @trulioo/trulioo-node-sdk
Alternatively, if using Yarn:
yarn add @trulioo/trulioo-node-sdk
.NET (C#)
For .NET applications, the SDK is available as a NuGet package. It can be installed using the .NET CLI, the NuGet Package Manager Console in Visual Studio, or the Package Manager GUI.
Using the .NET CLI:
dotnet add package Trulioo.Client
Using the NuGet Package Manager Console in Visual Studio:
Install-Package Trulioo.Client
Quickstart example
The following Python example demonstrates a basic integration using the Trulioo Python SDK to perform an identity verification check. This snippet assumes you have your Trulioo API key and a valid configuration for a specific country and product. Always replace placeholder values with your actual credentials and data.
Before running, ensure you have set environment variables for your Trulioo API key and base URL, or configure them directly as shown (though environment variables are recommended for security).
import os
from trulioo_python_sdk.client import TruliooClient
from trulioo_python_sdk.models import VerifyRequest, CountrySpecificInfo, DataField
# --- Configuration (Use environment variables in production) ---
API_KEY = os.environ.get("TRULIOO_API_KEY", "YOUR_TRULIOO_API_KEY")
BASE_URL = os.environ.get("TRULIOO_BASE_URL", "https://api.trulioo.com/") # Or sandbox URL
client = TruliooClient(api_key=API_KEY, base_url=BASE_URL)
def verify_individual_example():
print("Attempting individual verification...")
# Define the verification request payload
request = VerifyRequest(
accept_trulioo_terms_and_conditions=True,
cleansed_address=False,
call_back_url="https://your-callback-url.com/webhook",
configuration_name="Identity Verification", # Name of your configuration
country_code="US",
data_fields={
"personInfo": DataField(
first_name="John",
last_name="Doe",
day_of_birth=1,
month_of_birth=1,
year_of_birth=1990,
gender="M"
),
"location": DataField(
building_name="",
street_name="Main Street",
street_type="St",
street_number="123",
city="Anytown",
state_province_code="CA",
postal_code="90210"
),
"driversLicense": DataField(
number="ABC12345",
state_province_code="CA"
)
},
verbose_mode=True
)
try:
response = client.verify.verify(verify_request=request)
print("Verification successful:")
print(f"Transaction ID: {response.transaction_id}")
print(f"Is Valid: {response.is_whole_trace_valid}")
if response.errors:
print("Errors:")
for error in response.errors:
print(f" Code: {error.code}, Message: {error.message}")
if response.records:
print("Records:")
for record in response.records:
print(f" Record Status: {record.record_status}")
for field in record.field_groups:
print(f" Field Group: {field.field_group_name}")
for field_name, result in field.field_results.items():
print(f" {field_name}: {result.field_status}")
except Exception as e:
print(f"An error occurred during verification: {e}")
if __name__ == "__main__":
verify_individual_example()
This Python quickstart illustrates:
- Importing the necessary
TruliooClientand data models. - Initializing the client with an API key and base URL.
- Constructing a
VerifyRequestobject with individual and location data. - Making an asynchronous call to the
verifyendpoint. - Parsing and printing key information from the verification response, including transaction ID, overall validity, and details of individual field checks.
Developers should test their integrations thoroughly in Trulioo's sandbox environment before deploying to production. The sandbox allows for testing various scenarios without incurring costs or affecting live data. Authentication for the Trulioo API is typically handled via an API key, which should be treated as a sensitive credential. Best practices for securing API keys, such as using environment variables or a secrets management system, are recommended, as detailed in guides for managing API keys securely on Google Cloud.
Community libraries
While Trulioo provides official SDKs, the broader developer community may contribute additional libraries, integrations, or tools that extend functionality or support other languages/frameworks. These community-driven projects are not officially maintained or supported by Trulioo but can offer alternative approaches or niche solutions.
When considering community libraries, developers should evaluate several factors:
- Maintenance Status: Check the project's activity, recent commits, and issue resolution rate.
- Documentation: Assess the quality and completeness of documentation and examples.
- Security: Verify that the library handles sensitive data (like API keys and PII) securely and adheres to best practices.
- Compatibility: Ensure the library is compatible with the target Trulioo API version and your project's technology stack.
- Licensing: Understand the open-source license under which the library is distributed.
Resources like GitHub, package managers for various languages (e.g., PyPI, npm, Maven Central), and developer forums are common places to discover community contributions. Developers are encouraged to share their own integrations or improvements, fostering a collaborative ecosystem around Trulioo's APIs.
As of this writing, prominent, widely adopted community-maintained Trulioo client libraries comparable to the official SDKs are not broadly documented. Developers seeking a language client not officially supported by Trulioo might need to construct their own API client using HTTP libraries (e.g., requests in Python, axios in Node.js, HttpClient in .NET) and adhere to the Trulioo API specification directly. This approach requires manual handling of request serialization, response deserialization, error handling, and authentication, which the official SDKs simplify.