Overview
DPDPA Shield Developer SDK & REST API
Official developer integration guide for building automated DPDPA 2023 compliance into your applications.
npm install @dpdpashield/sdk
Initialize SDK & Authenticate
typescriptimport { DpdpaShieldClient } from '@dpdpashield/sdk';
const shield = new DpdpaShieldClient({
apiKey: process.env.DPDPA_SHIELD_API_KEY,
environment: 'production', // AWS Mumbai endpoint
telemetry: false
});
// Check active compliance score
const health = await shield.compliance.getHealth();
console.log(`Score: ${health.score}%`);Record Immutable Consent Event
typescriptconst consentReceipt = await shield.consent.record({
dataPrincipalId: 'usr_849201',
purposes: ['ACCOUNT_CREATION', 'KYC_VERIFICATION'],
noticeVersion: 'v2.4_hi',
language: 'hi',
affirmativeAction: 'BIOMETRIC_TOUCH_ID',
ipAddress: '203.0.113.195'
});
console.log(`SHA-256 Stamp: ${consentReceipt.sha256Proof}`);Configuration Parameters
| Parameter | Type | Description |
|---|---|---|
| apiKey | string (Required) | Your secret production API key from the DPDPA Shield Dashboard. |
| environment | 'production' | 'sandbox' | Endpoints default to AWS Mumbai (ap-south-1). |
| telemetry | boolean | Set to false for zero outbound non-essential telemetry. |
Need sandbox API keys for testing?
Create a free developer assessment account in under 60 seconds.