SDK Documentation

The SDK documentation explains the series of libraries and functions that help dApps interact with the Litentry protocol and the IdentityHub.

The client-sdk is a series of libraries authored by the Litentry team to help dApps interact with the Litentry protocol and the IdentityHub.

With the client-sdk , dApps can:

  • Link identities.

  • Request Verifiable Credentials.

  • Verify Verifiable Credentials.

  • Query an id_graph and its hash

Installation of the Client SDK packages

The client-sdk is distributed as a series of TypeScript packages available publicly on NPM. Install the package by running:

npm install @litentry/chain-types @litentry/enclave @litentry/vc-sdk

The following dependencies are needed too, if not installed already:

npm install @polkadot/api

Instantiate a new API connection

The client-sdk requires a Polkadot.js ApiPromise instance with the provider pointing to the Litentry Protocol networks.

Create a new Api instance using Litentry’s network type definitions.

import { ApiPromise, WsProvider } from '@polkadot/api';
import {
  identityManagement,
  trustedCalls,
} from '@litentry/chain-types';

const litentryNetworkApiTypes = {
  ...trustedCalls.types,
  ...identityManagement.types,
};

const wsProvider = new WsProvider(
	'wss://tee-dev.litentry.io'
);

const api = await ApiPromise.create({
  provider: wsProvider,
  types: litentryNetworkApiTypes,
});

Next, check what dApps can do with the client-sdk.

Last updated