Cr3dentials SDK

Developer guide for using the Cr3dentials SDK to automate login flows and extract data from multiple platforms. Supported Platforms: The SDK works with any platform that requires authentication.

Table of Contents

  • Getting Your API Key

  • Quick Start

  • Platform Identifiers

  • Login & Capture Data

  • Verify Specific Transactions

  • Manual Verification (ZK Proof Model)

  • Extract Custom Data

  • Configuration

  • Error Handling

  • Best Practices

  • Complete Examples

Getting Your API Key

Before using the SDK, you need API keys from Cr3dentials and Google AI:

Partner API Key (Cr3dentials)

  1. Sign up / Log in to Cr3dentials at: https://app.cr3dentials.xyz

  2. Navigate to Dashboard: Go to the Partner API section

  3. Generate API Key: Click "Generate New API Key" or copy your existing key

  4. Save Securely: Store the API key in your .env file (never commit to Git)

Google API Key (for Gemini AI)

  1. Visit: https://aistudio.google.com/app/apikey

  2. Click "Create API Key"

  3. Copy and add to your .env file

Environment Setup

Quick Start

Install the SDK:

Basic usage (example with Providus Bank):

Platform Identifiers

Each platform you integrate needs a unique identifier (e.g., "providus_bank", "your_bank", "your_platform").

Available Platform Strategies:

  • providus_bank - Providus Bank (Nigeria) with transaction capture

Adding Your Own Platform: You can use the SDK with any platform by:

  1. Choosing a unique platform identifier

  2. Using that identifier in universalLogin()

  3. The SDK will discover and cache the login flow automatically

Login & Capture Data

The SDK automatically logs into any platform and captures relevant data.

Example: Providus Bank (Transaction Data)

Providus Bank automatically captures transaction data during login:

Transaction Data Structure

Using with Other Platforms

The same pattern works for any platform:

Verify Specific Transactions (Providus Bank)

Note: Transaction verification via platformConfig is a Providus Bank-specific feature. Other platforms may have different platformConfig options based on their capabilities.

For Providus Bank, you can automatically verify if a specific transaction exists during login:

Verification options:

  • desc - Transaction description (partial match)

  • recipient - Recipient name (partial match)

  • orderRef - Order reference (include "order:" prefix)

  • amount - Amount to verify (string or number)

  • transactionType - "debit" or "credit"

  • dateRange - { from: "DD/MM/YYYY", to: "DD/MM/YYYY" }

All criteria use AND logic (all must match).

Manual Verification (ZK Proof Model)

If you don't want the SDK to automatically log in on behalf of users, you can use the manual verification workflow (similar to zkp2p). In this model:

  • Users manually log into their bank/platform themselves

  • The SDK provides a verification session and monitors for proof

  • No credentials are shared with your application

  • Users maintain full control and privacy

This approach is ideal for:

  • Privacy-focused applications

  • Compliance requirements where credential sharing is restricted

  • User-controlled verification flows

  • Zero-knowledge proof architectures

Using the API-Only Client

For manual verification workflows, use Cr3dentialsApiClient instead of the full SDK:

Note: The API-only client is lightweight and doesn't require browser automation dependencies.

Step 1: Get Available Verification Types

First, discover what types of verification are available:

Step 2: Get Sources for a Verification Type

Get available platforms/sources for a specific verification type:

Step 3: Create a Verification Session

Create a session where the user will manually verify:

Step 4: Direct User to Verification URL

Present the verification URL to your user:

Step 5: Poll for Verification Status

Monitor the verification session for completion:

Step 6: Handle Verification Results

Once the verification is complete, process the results:

Complete Manual Verification Example

Instead of polling, configure webhooks to receive real-time updates:

Session Status Reference

  • PENDING - Session created, waiting for user action

  • PROCESSING - User is completing verification steps

  • COMPLETED - Verification successful, data available

  • REVIEWING - Manual review required

  • FAILED - Verification failed (technical error)

  • REJECTED - Verification rejected (criteria not met)

  • EXPIRED - Session expired before completion

Extract Custom Data

After login, you can perform additional actions and extract custom data from any platform using natural language.

Example: Providus Bank

Using with Any Platform

The same approach works for any platform - just change the platform identifier and extraction logic:

Configuration

SDK Configuration

Note: The sourceName should match the platform identifier you use in universalLogin(). This enables flow caching for faster subsequent logins.

Environment Variables

Error Handling

Best Practices

1. Always Use Try-Finally

2. Use Environment Variables

3. Development vs Production

4. Monitor Live Sessions

5. Reuse SDK Instance

Complete Examples

All examples below use Providus Bank as the platform. To use with other platforms, simply change the platform identifier and adjust the data extraction logic for your platform's data structure.

Example 1: Basic Login & Data Capture

Example 2: Transaction Verification

Example 3: Custom Data Extraction

Last updated