DCID SDK Documentation
Build complete decentralized identity applications with our SDK suite. The platform consists of two SDKs that work together:
| SDK | Purpose | Language |
|---|---|---|
| **Frontend SDK** (`@dcid/sdk`) | Client-side identity wallet for React Native, Extensions, Web | TypeScript |
| **Backend SDK** (`@dcid/server-sdk`) | Server-side API for authentication, credentials, verification | TypeScript, Python, Go, PHP |
Architecture Overview
How They Work Together
- **Frontend SDK** runs in your user-facing application (mobile app, browser extension, or web app)
- **Backend SDK** runs on your server and handles secure operations
- Frontend connects to your backend via the `apiUrl` configuration
- Your backend uses the Backend SDK to communicate with the DCID Platform
Frontend SDK
The **Frontend SDK** (`@dcid/sdk`) is for building client-side identity wallets.
Platform Support
| Platform | Security | Use Case | Example |
|---|---|---|---|
| **React Native** | High | Production mobile apps | react-native-app |
| **Browser Extension** | High | Production browser wallets | browser-extension |
| **Web Application** | Low | Development/testing only | web-app |
Key Features
- Decentralized Identity (DID) creation and management
- Verifiable Credential storage and presentation
- Zero-Knowledge Proof generation
- HSM integration for key security
- OTP authentication flow
- Cross-platform with unified API
Backend SDK
The **Backend SDK** (`@dcid/server-sdk`) is for building servers that handle identity operations.
Language Support
| Language | Package | Status |
|---|---|---|
| **TypeScript** | `@dcid/server-sdk` | Primary |
| **Python** | `dcid-server-sdk` | Supported |
| **Go** | `github.com/gettrustid/dcid-backend-sdk/golang` | Supported |
| **PHP** | `dcid/server-sdk` | Supported |
Key Features
- OTP authentication (email/phone)
- JWT token management with auto-refresh
- Credential issuance (SIG and MTP types)
- IPFS credential storage
- Zero-Knowledge proof verification
- Encryption key management (HSM)
Quick Start
1. Set Up Your Backend
// Install: npm install @dcid/server-sdk express
// server.ts
import { DCIDServerSDK } from '@dcid/server-sdk';
import express from 'express';
const sdk = new DCIDServerSDK({
apiKey: process.env.DCID_API_KEY,
environment: 'prod'
});
const app = express();
app.use(express.json());
// Auth endpoints for frontend
app.post('/auth/initiate', async (req, res) => {
const result = await sdk.auth.registerOTP({ email: req.body.email });
res.json(result);
});
app.post('/auth/confirm', async (req, res) => {
const result = await sdk.auth.confirmOTP({
email: req.body.email,
otp: req.body.code
});
res.json(result);
});
app.listen(3001, () => console.log('Server running on :3001'));2. Connect Your Frontend
Next Steps
Frontend Development
- Frontend Getting Started
- Installation
- Platform Guides (React Native, Extension, Web)
- API Reference
Backend Development
- Backend Getting Started
- Installation
- Server Setup
- API Reference