Skip to Content
SDKOverview

SDK Overview

The Solidus SDK is a set of TypeScript packages for interacting with the Solidus Network. Create DIDs, issue and verify credentials, and authenticate users — all from a few function calls.

Packages

PackagenpmDescription
@solidus-network/sdknpmMain SDK — DID operations, credential issuance/verification, auth challenges
@solidus-network/authnpmAuth primitives — challenge-response protocol for DID-based authentication
@solidus-network/typesnpmTypeScript type definitions shared across all packages
@solidus-network/jwt(not yet published)JWT utilities — sign, verify, and decode JWTs with Ed25519 keys

Installation

npm install @solidus-network/sdk @solidus-network/auth @solidus-network/types

Or with other package managers:

pnpm add @solidus-network/sdk @solidus-network/auth @solidus-network/types
yarn add @solidus-network/sdk @solidus-network/auth @solidus-network/types

SDK Modes

The SDK supports three operating modes, controlled by the mode option when creating the client.

ModeBackendUse case
stubLocal Postgres databaseLocal development and testing — no network calls
testnetJSON-RPC to rpc.solidus.networkIntegration testing against the live testnet
mainnetJSON-RPC to mainnet (reserved)Production — not yet available

Quick Start

import \{ createSdk \} from '@solidus-network/sdk' // 1. Create the SDK client in testnet mode const sdk = createSdk(\{ mode: 'testnet', chain: \{ rpcUrl: 'https://rpc.solidus.network', signerPrivateKey: process.env.SIGNER_PRIVATE_KEY, network: 'testnet', \}, \}) // 2. Generate a key pair and create a DID const keyPair = crypto.getRandomValues(new Uint8Array(32)) const did = await sdk.did.create(\{ publicKey: keyPair \}) console.log(did.id) // "did:solidus:testnet:7Kf9..." // 3. Issue a credential const credential = await sdk.credentials.issue(\{ subjectDid: did.id, issuerDid: 'did:solidus:testnet:issuer123', issuerPrivateKey: process.env.ISSUER_PRIVATE_KEY, type: ['VerifiableCredential', 'KYCCredential'], claims: \{ level: 1, country: 'US', verifiedAt: new Date().toISOString(), \}, expiresInDays: 365, \}) // 4. Verify the credential const result = await sdk.credentials.verify(credential) console.log(result.valid) // true console.log(result.checks.signature) // true console.log(result.checks.expiry) // true console.log(result.checks.revocation) // true

Next Steps

Last updated on