{"_id":"@canton-vc/adapter-didit","_rev":"3-c57b1d30f04a723a24aadf71cab76d14","name":"@canton-vc/adapter-didit","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@canton-vc/adapter-didit","version":"0.1.0","keywords":["canton","kyc","didit","adapter","canton-vc"],"author":{"url":"https://github.com/Farukest","name":"Abdullah Faruk Özden","email":"abdullahfarukozden@gmail.com"},"license":"Apache-2.0","_id":"@canton-vc/adapter-didit@0.1.0","maintainers":[{"name":"0xflydev","email":"0xflydev@gmail.com"}],"homepage":"https://github.com/Farukest/canton-vc/tree/main/packages/adapter-didit#readme","bugs":{"url":"https://github.com/Farukest/canton-vc/issues"},"dist":{"shasum":"2949d06b8ab001ed20e00795e50be632851568c3","tarball":"https://registry.npmjs.org/@canton-vc/adapter-didit/-/adapter-didit-0.1.0.tgz","fileCount":7,"integrity":"sha512-bT4YYXa9D1+O12Ta2UNy+L9ZeyaRGpC8eRi+uLNwY4b+gFUcBB+WZwR5gbdjUI45NsEJ5L8qCf80rpFGHSPdGw==","signatures":[{"sig":"MEUCIFCI94Qwfe8CkSE86BsX1fyYMIR1wPvOM98IpI9Cctm4AiEA4Dm1Q5dPa+YT884MZhALa522cnqRawEp+IsCrDLqF1k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40698},"main":"./src/index.ts","type":"module","_from":"file:canton-vc-adapter-didit-0.1.0.tgz","types":"./src/index.ts","engines":{"node":">=18"},"exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"lint":"biome check src tests","test":"vitest run","clean":"rm -rf .turbo dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"0xflydev","email":"0xflydev@gmail.com"},"_resolved":"C:\\Users\\FARUKE~1\\AppData\\Local\\Temp\\6617de2091ef2ac86a07016b4726b2ed\\canton-vc-adapter-didit-0.1.0.tgz","_integrity":"sha512-bT4YYXa9D1+O12Ta2UNy+L9ZeyaRGpC8eRi+uLNwY4b+gFUcBB+WZwR5gbdjUI45NsEJ5L8qCf80rpFGHSPdGw==","repository":{"url":"git+https://github.com/Farukest/canton-vc.git","type":"git","directory":"packages/adapter-didit"},"_npmVersion":"11.6.2","description":"Didit KYC provider adapter for canton-vc. Wraps the Didit v3 sessions API (POST /v3/session/, GET /v3/session/{id}/decision/) and HMAC-SHA256 webhook signatures behind the vendor-agnostic KycProvider interface.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"zod":"4.3.6","@canton-vc/core":"0.1.0","@canton-vc/kyc-provider":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"2.1.8","typescript":"5.6.3","@types/node":"22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/adapter-didit_0.1.0_1779586280054_0.9200576869341963","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@canton-vc/adapter-didit","version":"0.2.0","keywords":["canton","kyc","didit","adapter","canton-vc"],"author":{"url":"https://github.com/Farukest","name":"Abdullah Faruk Özden","email":"abdullahfarukozden@gmail.com"},"license":"Apache-2.0","_id":"@canton-vc/adapter-didit@0.2.0","maintainers":[{"name":"0xflydev","email":"0xflydev@gmail.com"}],"homepage":"https://github.com/Farukest/canton-vc/tree/main/packages/adapter-didit#readme","bugs":{"url":"https://github.com/Farukest/canton-vc/issues"},"dist":{"shasum":"0ea9e7450a26a0b8b8f8f5ce74e0d80c1d855263","tarball":"https://registry.npmjs.org/@canton-vc/adapter-didit/-/adapter-didit-0.2.0.tgz","fileCount":7,"integrity":"sha512-Xstazis7nUAFO71b/+k27hJQRmbOfNbd6hh++4usovH2qhapD8USKifwfiwFvUxSOB5fTmot5+qSUrL/jZuoDQ==","signatures":[{"sig":"MEYCIQD6OOr34qYUUEVr9I1ZI0bW89232uMdvsgJmeY20Ue2MQIhALN3B/pNqsA8WJJG/j0/DZRal2Ip1+USVj4zc5Il4uxI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40698},"main":"./src/index.ts","type":"module","_from":"file:canton-vc-adapter-didit-0.2.0.tgz","types":"./src/index.ts","engines":{"node":">=18"},"exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"lint":"biome check src tests","test":"vitest run","clean":"rm -rf .turbo dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"0xflydev","email":"0xflydev@gmail.com"},"_resolved":"C:\\Users\\FARUKE~1\\AppData\\Local\\Temp\\7a8ef5014cd47ebcc22724199cc451a0\\canton-vc-adapter-didit-0.2.0.tgz","_integrity":"sha512-Xstazis7nUAFO71b/+k27hJQRmbOfNbd6hh++4usovH2qhapD8USKifwfiwFvUxSOB5fTmot5+qSUrL/jZuoDQ==","repository":{"url":"git+https://github.com/Farukest/canton-vc.git","type":"git","directory":"packages/adapter-didit"},"_npmVersion":"11.6.2","description":"Didit KYC provider adapter for canton-vc. Wraps the Didit v3 sessions API (POST /v3/session/, GET /v3/session/{id}/decision/) and HMAC-SHA256 webhook signatures behind the vendor-agnostic KycProvider interface.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"zod":"4.3.6","@canton-vc/core":"0.2.0","@canton-vc/kyc-provider":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"2.1.8","typescript":"5.6.3","@types/node":"22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/adapter-didit_0.2.0_1779984353883_0.357512865580512","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@canton-vc/adapter-didit","version":"0.3.0","description":"Didit KYC provider adapter for canton-vc. Wraps the Didit v3 sessions API (POST /v3/session/, GET /v3/session/{id}/decision/) and HMAC-SHA256 webhook signatures behind the vendor-agnostic KycProvider interface.","license":"Apache-2.0","type":"module","main":"./src/index.ts","types":"./src/index.ts","exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"}},"sideEffects":false,"engines":{"node":">=18"},"dependencies":{"zod":"4.3.6","@canton-vc/core":"0.3.0","@canton-vc/kyc-provider":"0.3.0"},"devDependencies":{"@types/node":"22.10.2","typescript":"5.6.3","vitest":"2.1.8"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/Farukest/canton-vc.git","directory":"packages/adapter-didit"},"keywords":["canton","kyc","didit","adapter","canton-vc"],"author":{"name":"Abdullah Faruk Özden","email":"abdullahfarukozden@gmail.com","url":"https://github.com/Farukest"},"homepage":"https://github.com/Farukest/canton-vc/tree/main/packages/adapter-didit#readme","bugs":{"url":"https://github.com/Farukest/canton-vc/issues"},"scripts":{"lint":"biome check src tests","typecheck":"tsc --noEmit","test":"vitest run","clean":"rm -rf .turbo dist"},"_id":"@canton-vc/adapter-didit@0.3.0","_integrity":"sha512-ypYjGRKcKcDVU/rFW1pYh4+bldx+xe81h/ntcmmlBJQhTZH4w0cVl4zyQSPks8okkYGuPkB2IWK+r+pbfxNERg==","_resolved":"C:\\Users\\FARUKE~1\\AppData\\Local\\Temp\\83d2446ac93f25f5f002df8849e45d35\\canton-vc-adapter-didit-0.3.0.tgz","_from":"file:canton-vc-adapter-didit-0.3.0.tgz","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-ypYjGRKcKcDVU/rFW1pYh4+bldx+xe81h/ntcmmlBJQhTZH4w0cVl4zyQSPks8okkYGuPkB2IWK+r+pbfxNERg==","shasum":"3a12e3159b113549afae26c0b9c151759770b131","tarball":"https://registry.npmjs.org/@canton-vc/adapter-didit/-/adapter-didit-0.3.0.tgz","fileCount":7,"unpackedSize":40698,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDD+m5ZRu8BaDiI2RxUazU1XbGxxtJfOFQccwPQFRvbcQIhAOAmIq3BCqe1fD/gGg0VyOb2iSG37/Yku22lgDDrp0Nm"}]},"_npmUser":{"name":"0xflydev","email":"0xflydev@gmail.com"},"directories":{},"maintainers":[{"name":"0xflydev","email":"0xflydev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adapter-didit_0.3.0_1780019775254_0.49115275902773226"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-24T01:31:19.834Z","modified":"2026-05-29T01:56:15.567Z","0.1.0":"2026-05-24T01:31:20.201Z","0.2.0":"2026-05-28T16:05:54.039Z","0.3.0":"2026-05-29T01:56:15.436Z"},"bugs":{"url":"https://github.com/Farukest/canton-vc/issues"},"author":{"name":"Abdullah Faruk Özden","email":"abdullahfarukozden@gmail.com","url":"https://github.com/Farukest"},"license":"Apache-2.0","homepage":"https://github.com/Farukest/canton-vc/tree/main/packages/adapter-didit#readme","keywords":["canton","kyc","didit","adapter","canton-vc"],"repository":{"type":"git","url":"git+https://github.com/Farukest/canton-vc.git","directory":"packages/adapter-didit"},"description":"Didit KYC provider adapter for canton-vc. Wraps the Didit v3 sessions API (POST /v3/session/, GET /v3/session/{id}/decision/) and HMAC-SHA256 webhook signatures behind the vendor-agnostic KycProvider interface.","maintainers":[{"name":"0xflydev","email":"0xflydev@gmail.com"}],"readme":"# @canton-vc/adapter-didit\n\nReference [`KycProvider`](../kyc-provider) implementation for the\n[Didit](https://didit.me) KYC vendor.\n\n## Install\n\n```bash\npnpm add @canton-vc/adapter-didit @canton-vc/kyc-provider\n```\n\n## Usage\n\n```ts\nimport { DiditAdapter } from '@canton-vc/adapter-didit';\n\nconst kyc = new DiditAdapter({\n  apiKey: process.env.DIDIT_API_KEY!,\n  webhookSecret: process.env.DIDIT_WEBHOOK_SECRET!,\n  kycWorkflowId: process.env.DIDIT_KYC_WORKFLOW_ID!,\n  // optional:\n  addressWorkflowId: process.env.DIDIT_ADDRESS_WORKFLOW_ID,\n  callbackUrl: 'https://your-issuer.com/kyc/callback',\n});\n\n// 1. Start a session — redirect the user to session.redirectUrl\nconst session = await kyc.startSession({ userRef: 'user-123' });\n\n// 2. Pull the decision after callback (or webhook fallback)\nconst decision = await kyc.fetchDecision(session.sessionId);\n// decision.status === 'approved' | 'declined' | 'in_review' | 'pending' | 'expired'\n\n// 3. Verify webhook (in your /webhook/didit handler)\nconst event = await kyc.verifyWebhook(rawBody, request.headers);\nif (event === null) return new Response('invalid', { status: 400 });\n// event.type === 'decision' | 'session.expired'\n```\n\n## Webhook signature\n\nDidit signs every webhook with HMAC-SHA256 over the canonical JSON of\nthe body, sent in the `X-Signature-V2` header. The adapter enforces\nthe signature + a 5-minute drift window on `X-Timestamp`. Override\nthe drift window via `webhookDriftSeconds` if your operator policy\ndiffers.\n\n## Configuration reference\n\n| Field | Required | Default | Purpose |\n|---|---|---|---|\n| `apiKey` | ✅ | — | Didit API key. |\n| `webhookSecret` | ✅ | — | Signing secret for webhook HMACs. |\n| `kycWorkflowId` | ✅ | — | Workflow id for identity verification. |\n| `addressWorkflowId` |   | — | Workflow id for proof-of-address sessions. |\n| `callbackUrl` |   | — | URL Didit redirects the user back to. |\n| `baseUrl` |   | `https://verification.didit.me` | API root (override for sandbox). |\n| `webhookDriftSeconds` |   | `300` | Max allowed `X-Timestamp` drift. |\n| `requestTimeoutMs` |   | `10000` | Per-request HTTP timeout. |\n| `fetch` |   | `globalThis.fetch` | Override the fetch implementation. |\n| `clock` |   | `Date.now` | Override the wall-clock source. |\n\n## Implementing another vendor\n\nLook at this adapter, [`@canton-vc/adapter-sumsub`](../adapter-sumsub),\nand the `KycProvider` interface in\n[`@canton-vc/kyc-provider`](../kyc-provider/src/index.ts). The two\nreference adapters cover the two common authentication patterns\nmost KYC vendors use: token-auth with canonical-JSON HMAC (Didit),\nand per-request HMAC with raw-body digest (Sumsub). Pick whichever\nmatches your target vendor and adapt from there. Open an issue with\nthe vendor name to claim the next adapter.\n\n## License\n\nApache 2.0 — see [LICENSE](../../LICENSE).\n","readmeFilename":"README.md"}