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
typescript
import { 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
typescript
const 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

ParameterTypeDescription
apiKeystring (Required)Your secret production API key from the DPDPA Shield Dashboard.
environment'production' | 'sandbox'Endpoints default to AWS Mumbai (ap-south-1).
telemetrybooleanSet to false for zero outbound non-essential telemetry.

Need sandbox API keys for testing?

Create a free developer assessment account in under 60 seconds.

Get API Key