Server-Side Libraries

This section explains how you can integrate Passbase into your backend and interact with our API.


Some clients are legally required to hold a copy of their customers' Personal data. In this case, you can retrieve any of the Data points relative to a Verification from the Passbase API:
  • The Data points required in the Verification (i.e first name, last name, document number, identity score)
  • Any metadata relative to the Verification (i.e. user agent, timestamp, user references)
We recommend you request & store as few pieces of information as possible about your users on your side. This decreases your data liability to the extent, that you only have to protect the data you truly need. If you only care that a user has been verified or is over a certain age, then you should store this as a boolean (true/false) once Passbase has completed the identity or age verification of that user.


In the previous sections, we worked with the client-side SDKs. We used the publishable API key there. Since we are now working in a server-to-server environment, you need to use the secret API key. Please never share this API key or commit it to a repo, since it gives access to your sensitive user data. If you leak this API key, a potential bad actor could retrieve and expose information about the identities of your users.
Be very careful with the secret API key. Never share it or send it through unencrypted communication methods!

Install a Server-Side Library

Follow the instructions below to install the latest Passbase server-side library in your backend project.
Add @passbase/node npm package to your package.json.
Passbase has no dependency but expects node version to be LTS (12.x).
// Run
npm install @passbase/node --save
Add Passbase's SDK package to your requirements.txt.
The SDK should work on both python 2.7 and 3+
pip install passbase_sdk && pip freeze | grep passbase_sdk >> requirements.txt
// Maven users, add this dependency to your project's POM:
//Gradle users, add this dependency to your project's build.gradle:
compile "com.passbase:passbase:0.0.1"
// Add Passbase to your dependencies
go get
# Add Passbase's SDK gem to your Gemfile.
gem 'passbase', '~> 0.0.1'
//To install the bindings via Composer, add the following to `composer.json`:
"repositories": [
"type": "git",
"url": ""
// Then run composer install

Usage of the Library

You can use the sample code below to initialize the server-side libraries and interact with the Passbase API. Please do not forget to use your secret API key in the header. The code below shows an example of how to request data from the Passbase API.
You can find more information about all the different functions/methods of the server-side libraries on their individual Github repository.
const {
} = require("@passbase/node");
async function main() {
const apiKey = "YOUR_SECRET_API_KEY";
// Configure the SDK with your API Secret access key
const config = new PassbaseConfiguration({
format: ResponseFormats.Json,
const client = new PassbaseClient(config);
// Get project settings
const settings = await client.getProjectSettings();
console.log(JSON.stringify(settings, null, 4));
main().catch(err => {
import passbase
from pprint import pprint
# Configure the SDK with your API Secret access key
configuration = passbase.Configuration()
configuration.api_key["X-API-KEY"] = "YOUR_SECRET_API_YEY"
api_client = passbase.ApiClient(configuration)
api_instance = passbase.ProjectApi(api_client)
# Get project settings
api_response = api_instance.get_settings()
except Exception as e:
print("Exception when calling ProjectApi->get_settings: %s\n" % e)
import com.passbase.*;
import com.passbase.api.ProjectApi;
import com.passbase.model.ProjectSettings;
import java.util.List;
import java.util.Map;
public final class App {
public static void main(String[] args) {
// Configure the SDK with your API Secret access key
ApiClient defaultClient = Configuration.getDefaultApiClient();
ProjectApi apiInstance = new ProjectApi(defaultClient);
try {
// Get project settings
ProjectSettings settings = apiInstance.getSettings();
} catch (ApiException e) {
private static void printError(ApiException e) {
System.err.println("Exception when calling ProjectApi#getSettings");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
package main
import (
passbase ""
func main() {
// Configure the SDK with your API Secret access key
client := passbase.NewAPIClient(passbase.NewConfiguration())
ctx := context.WithValue(context.Background(), passbase.ContextAPIKey, passbase.APIKey{
// Get project settings
settings, _, err := client.ProjectApi.GetSettings(ctx)
if err != nil {
fmt.Println("Setting for ", settings.Slug, "->", settings)
require 'passbase'
# Setup authorization
Passbase.configure do |config|
# Configure API key authorization: SecretApiKey
config.api_key['SecretApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['SecretApiKey'] = 'Bearer'
api_instance =
# Get project settings
result = api_instance.get_settings
p result
rescue Passbase::ApiError => e
puts "Exception when calling ProjectApi->get_settings: #{e}"
use App\Http\Controllers\Controller;
use Passbase\Configuration;
use Passbase\api\IdentityApi;
use GuzzleHttp\Client;
class APIController extends Controller
public function api_call()
// Configure the SDK with your API Secret access key
$config = Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'SECRET-KEY');
$apiInstance = new IdentityApi(
new Client(),
// Unique identity access key received from webhooks
$id= "identityAccessKey";
try {
$result = $apiInstance->getIdentityById($id);
} catch (Exception $e) {
echo 'Exception when calling IdentityApi->getIdentityById: ', $e->getMessage(), PHP_EOL;