Quadrata Integration
  • INTRODUCTION
    • Introduction to Quadrata
    • Passport Attributes
  • HOW TO INTEGRATE
    • Quadrata SDK
      • Get Started Quickly
      • Advanced
        • Installation
        • SDK Configuration
        • Onboarding Example
        • Client Libraries
          • Client Configuration
          • Client Lazy Loading
          • Client Eager Loading
          • Client Helper Component
          • Client React Hooks
            • useOnboardStatus
          • Client Examples
            • With Wagmi Connect
            • KYC Only
            • KYB Only
            • All In One
        • API Libraries
          • API Configuration
          • API Service Options
          • API Service Libraries
            • Create Access Token
            • Create Privacy Access Token
            • Fetch Attribute Values
            • Fetch Onboard Status
            • Fetch Passport List
            • Fetch Privacy Data
            • Fetch Privacy Grants
            • Fetch Wallet Screening
            • Revoke Privacy Grants
    • Onboard users
      • Individual Passport Onboarding
        • 1. Installation
        • 2. API Authentication
        • 3. API Onboard Status
        • 4. QuadClient Package
        • 5. Privacy Data Permissions
        • 6. Full Example
      • Business Passport Onboarding
        • 1. Installation
        • 2. API Authentication
        • 3. QuadrataKyb Package
        • 4. Privacy Data Permissions
        • 5. Full Example
      • All-In-One Passport Onboarding
        • 1. Installation
        • 2. API Authentication
        • 3. QuadrataReact Package
        • 4. Full Example
    • Request Privacy Data
      • List of Privacy Data
      • Privacy Data Permissions
      • API Requests
        • How to sign API
          • Full Example
          • Generate ECDSA Key Pair
        • API Get Privacy Permissions
        • API Privacy Access Token
        • API Get Privacy Data
        • API Revoke Permissions
    • Query attributes
      • Via Smart Contract
        • Query a single attribute
        • Query multiple attributes
        • Query Helper
      • Via API
    • On-Chain Wallet Screening
      • How to sign API
        • Full Example
        • Generate ECDSA Key Pair
      • API Get On-Chain AML Score
    • Webhooks
      • Onboarding Webhooks
      • Ongoing Monitoring Webhooks
      • Webhook Request Signature
    • Burn Passports
  • additional information
    • Smart contracts
    • Quadrata Sandbox
    • Passport Issuers
    • Privileged Roles & Ownership
    • Constants
    • Flex Kit Attributes
      • Smart Contract Addresses
Powered by GitBook
On this page
  • Runtime Environment and Allow Unsafe Client API Call
  • Example
  • API Signed Requests
  • Example
  1. HOW TO INTEGRATE
  2. Quadrata SDK
  3. Advanced
  4. API Libraries

API Service Options

Quadrata SDK API Service Options

PreviousAPI ConfigurationNextAPI Service Libraries

Last updated 10 months ago

Each API service will have different options that you can pass in.

Each service allows you to pass in options mapped to which are passed to the underlying fetch function. You can use this option to control cache behavior, add headers, and more.

Runtime Environment and Allow Unsafe Client API Call

Some API calls are intended to only be executed on the server.

Of these API calls that are only intended to be executed on the server, some of them allow you to pass an option to allowUnsafeClientApiCall. This option is a boolean that allows you to bypass the server check and execute the API call on the client.

Any service that requires a private key and generates a signed request does not allow you to pass this option.

Example

import { createAccessToken, QuadrataEnvironment } from '@quadrata/sdk/api';

const { data: { accessToken } } = await createAccessToken(
    // params
    {
        apiKey: process.env.QUADRATA_API_KEY,
        options: {
            // not recommended as it exposes your API key
            allowUnsafeClientApiCall: true,

            // optional fetch options
            cache: 'no-cache'
        }
    },
    // sdk config
    { environment: QuadrataEnvironment.PRODUCTION }
);

API Signed Requests

When using a service that generates a request signature, you must pass in your private key.

You have options as to how you can pass in your private key:

  • privateKeyPem: A string that contains the private key in PEM format.

  • privateKeyDerBase64: A base64 encoded string that contains the private key in DER format.

  • privateKeyDer: A binary string that contains the private key in DER format.

Example

import { fetchWalletScreening, QuadrataEnvironment } from '@quadrata/sdk/api';

const { data } = await fetchWalletScreening(
    // params
    {
        apiKey: process.env.QUADRATA_API_KEY,
        privateKeyDerBase64: process.env.QUADRATA_PRIVATE_KEY_DER_BASE64,
        walletAddress: '0x123',
        
        // optional fetch options
        options: {
            cache: 'no-cache'
        }
    },
    // sdk config
    { environment: QuadrataEnvironment.PRODUCTION }
);

privateKey: A object that contains the private key. (Uses )

RequestInit
CryptoKey
SubtleCrypto