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
  • Optional Peer Dependencies
  • KYC Onboarding
  • KYB Onboarding
  • With Wagmi Connect
  • Notes on optional dependencies
  • Typescript Configuration
  1. HOW TO INTEGRATE
  2. Quadrata SDK
  3. Advanced

Installation

Quadrata SDK Installation

PreviousAdvancedNextSDK Configuration

Last updated 10 months ago

To install the Quadrata SDK, you can use the following commands:

npm i --save @quadrata/sdk
npm i --save @quadrata/contracts

Optional Peer Dependencies

The SDK has optional peer dependencies that you will need to install, depending on which SDK libraries you want to use.

If you are not using the , then you do not need to consider any of the peer dependencies for installation.

If you are using client libraries at @quadrata/sdk/client then you will need to install the following packages in your project:

  • @quadrata/core-react

  • @tanstack/react-query

  • react

  • react-dom

npm i --save react
npm i --save react-dom
npm i --save @quadrata/core-react
npm i --save @tanstack/react-query

Each client onboarding application has its own package that you need to install in order to take advantage of the SDK for client onboarding, and all of them require @quadrata/core-react.


KYC Onboarding

For KYC onboarding, you need to install the following dependencies:

  • @quadrata/core-react

  • @quadrata/client-react

npm i --save @quadrata/core-react
npm i --save @quadrata/client-react

KYB Onboarding

For KYB onboarding, you need to install the following dependencies:

  • @quadrata/core-react

  • @quadrata/kyb-react

npm i --save @quadrata/core-react
npm i --save @quadrata/kyb-react

With Wagmi Connect

  • wagmi@2.X

  • viem@2

npm i --save wagmi
npm i --save viem

Notes on optional dependencies

Due to the static analysis performed by the bundler (like Webpack or Parcel) during the build process, when a module is imported, the bundler tries to resolve these modules at build time and not run time.

If you are using the SDK client libraries and you do not wish to install all of the peer dependencies, you need to tell your bundler how to handle packages that are not installed or you will receive Module not found errors.

NextJS uses Webpack and allows you to configure a fallback package for modules by name.

If you only need Individual Onboarding (KYC), for instance, and do not wish to install the Business Onboarding (KYB) react packages, you can tell webpack not to attempt to load the KYB package.

An example of this configuration would like like the following:

// next.config.mjs

const nextConfig = {
    // ...
    webpack: config => {
        config.resolve.fallback = {
            ...config.resolve.fallback,
            
            // do not attemp to load @quadrata/kyb-react
            '@quadrata/kyb-react': false
        };
        return config;
    },
};

export default nextConfig;

ViteJS uses esbuild and allows you to configure a fallback package for modules by name.

If you only need Individual Onboarding (KYC), for instance, and do not wish to install the Business Onboarding (KYB) react packages, you can tell webpack not to attempt to load the KYB package.

An example of this configuration would like like the following:

// vite.config.js

import { defineConfig } from 'vite';

export default defineConfig({
  resolve: {
    alias: {
      // do not attempt to load @quadrata/kyb-react
      '@quadrata/kyb-react': false
    }
  }
});

Typescript Configuration

In order for typescript to find the type definitions in @quadrata/sdk/types you might need to update your tsconfig.json.

Specifically, moduleResolution may need to be set to bundler.

Here are some example tsconfig.json files for different environments.

Here is an example tsconfig.json for a NextJS Application:

{
  "compilerOptions": {
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "~/*": ["./src/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}

Here is an example tsconfig.json for a ViteJS Application:

{
  "compilerOptions": {
    "target": "ES2020",
    "useDefineForClassFields": true,
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "module": "ESNext",
    "skipLibCheck": true,

    /* Bundler mode */
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",

    /* Linting */
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noFallthroughCasesInSwitch": true
  },
  "include": ["src"],
  "references": [{ "path": "./tsconfig.node.json" }]
}

You can find more information about installing @quadrata/client-react on the page.

You can find more information about installing @quadrata/kyb-react on the page.

If you want to use the built-in abstraction to connect wallets and sign transactions, you need to install the following dependencies:

SDK Client Libraries
Individual Passport Onboarding > Installation
Business Passport Onboarding > Installation
With Wagmi Connect