{"_id":"@br.gov.dataprev.inji/wallet-sdk","_rev":"7-77a917b263cfa26825a32189eb82ed02","name":"@br.gov.dataprev.inji/wallet-sdk","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.3":{"name":"@br.gov.dataprev.inji/wallet-sdk","version":"1.0.3","keywords":["verifiable-credentials","digital-identity","react-native","headless","sdk","event-driven","credentials","identity","security","DID","VP","VC","OpenID4VC","OpenID4VP","wallet"],"author":{"name":"VC SDK Team","email":"pankajchaudhary7121994@gmail.com"},"license":"MIT","_id":"@br.gov.dataprev.inji/wallet-sdk@1.0.3","maintainers":[{"name":"dataprev-inji","email":"alexandre.dekker@dataprev.gov.br"}],"dist":{"shasum":"96c7e0fdccf06a68eece185734f2937901a33504","tarball":"https://registry.npmjs.org/@br.gov.dataprev.inji/wallet-sdk/-/wallet-sdk-1.0.3.tgz","fileCount":135,"integrity":"sha512-9Sd4YNX+SuvferOrP2zmPh6ybwCRgAWsSobaT7LoYkcxBtP16EpPU3FluQ2Nbxn9M3d+HS5hunJXGB0AycNxLQ==","signatures":[{"sig":"MEQCIDsvrZvSr5DOT04MG5LMf84AZ/LLQCD9HadlPq3iWUtiAiAZQOkndzqwrOtqOPk1RLx9MaM6Naf7j/hD2HNTTBnzqA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1734514},"expo":{"autolinking":{"nativeModulesDir":"android"}},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/lib/"]},"main":"./lib/module/index.js","_from":"file:wallet-sdk-1.0.3.tgz","types":"./lib/typescript/index.d.ts","exports":{".":"./lib/module/index.js","./polyfills":"./lib/module/polyfills.js"},"scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","build":"bob build --target module","clean":"del-cli lib","prepare":"bob build --target module","typecheck":"tsc --noEmit","build:docs":"typedoc src --out docs/api","test:coverage":"jest --coverage"},"_npmUser":{"name":"dataprev-inji","email":"alexandre.dekker@dataprev.gov.br"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"_resolved":"/home/alexandre-dekker/Downloads/sdk/wallet-sdk-1.0.3.tgz","_integrity":"sha512-9Sd4YNX+SuvferOrP2zmPh6ybwCRgAWsSobaT7LoYkcxBtP16EpPU3FluQ2Nbxn9M3d+HS5hunJXGB0AycNxLQ==","app-plugin":"./app.plugin.js","_npmVersion":"11.8.0","description":"Headless Verifiable Credentials SDK for React Native - Pure logic layer with event-based API (no UI components)","directories":{},"_nodeVersion":"24.13.1","dependencies":{"bs58":"^5.0.0","uuid":"^11.0.3","buffer":"^6.0.3","jsonld":"^8.3.2","xstate":"^4.35.0","date-fns":"^2.26.0","elliptic":"^6.6.1","crypto-js":"^4.2.0","color-diff":"^1.4.0","jwt-decode":"^3.1.2","node-forge":"^1.3.1","@noble/hashes":"^1.8.0","eventemitter3":"^5.0.1","jsonpath-plus":"^10.0.0","@noble/ed25519":"^2.1.0","short-unique-id":"^4.4.4","@noble/secp256k1":"^2.3.0","base64url-universal":"^1.1.0","@digitalcredentials/vc":"^1.1.2","react-native-get-random-values":"^1.11.0"},"react-native":"./lib/module/index.js","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.35.0","del-cli":"^6.0.0","prettier":"^3.6.2","typescript":"^5.9.2","@types/jest":"^29.5.14","@types/node":"^20.0.0","@babel/preset-typescript":"^7.27.1","react-native-builder-bob":"^0.35.0"},"peerDependencies":{"expo-crypto":">=13.0.0","react-native-fs":">=2.18.0","react-native-mmkv":">=2.0.0","react-native-keychain":">=8.0.0","react-native-device-info":">=8.0.0","@react-native-community/netinfo":">=9.0.0","@react-native-async-storage/async-storage":">=1.17.0"},"peerDependenciesMeta":{"expo-crypto":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/wallet-sdk_1.0.3_1785257661471_0.7350710316349895","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["module",{"esm":true}],["typescript",{"project":"tsconfig.json"}]]}},"1.0.5":{"name":"@br.gov.dataprev.inji/wallet-sdk","version":"1.0.5","keywords":["verifiable-credentials","digital-identity","react-native","headless","sdk","event-driven","credentials","identity","security","DID","VP","VC","OpenID4VC","OpenID4VP","wallet"],"author":{"name":"VC SDK Team","email":"pankajchaudhary7121994@gmail.com"},"license":"MIT","_id":"@br.gov.dataprev.inji/wallet-sdk@1.0.5","maintainers":[{"name":"dataprev-inji","email":"alexandre.dekker@dataprev.gov.br"},{"name":"netlonde","email":"carloscomercialti@gmail.com"}],"dist":{"shasum":"e0ac1e181465ddf2f159b6ea21c126b4ecf65d04","tarball":"https://registry.npmjs.org/@br.gov.dataprev.inji/wallet-sdk/-/wallet-sdk-1.0.5.tgz","fileCount":135,"integrity":"sha512-zvPo6GXligJX68MZp3vKU3gAnxJgvCjEI/dCiIVmXKyOib4i+t0VgLVpVFMGd/39XkkUUgpIIekpZOUONNbDxw==","signatures":[{"sig":"MEUCIQDinDknS2O075mv4t9XqNTuMhAo8ZYsnreUU7JZ8V0WCQIgCFwBBi72s7lxs/p6fGuJirbYtHjEcvroHrl+iAEQuR4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1734736},"expo":{"autolinking":{"nativeModulesDir":"android"}},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/lib/"]},"main":"./lib/module/index.js","_from":"file:br.gov.dataprev.inji-wallet-sdk-1.0.5.tgz","types":"./lib/typescript/index.d.ts","exports":{".":"./lib/module/index.js","./polyfills":"./lib/module/polyfills.js"},"scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","build":"bob build --target module","clean":"del-cli lib","prepare":"bob build --target module","typecheck":"tsc --noEmit","build:docs":"typedoc src --out docs/api","test:coverage":"jest --coverage"},"_npmUser":{"name":"netlonde","email":"carloscomercialti@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"_resolved":"C:\\app-inji\\sdkdoscm\\inji-wallet-sdk\\br.gov.dataprev.inji-wallet-sdk-1.0.5.tgz","_integrity":"sha512-zvPo6GXligJX68MZp3vKU3gAnxJgvCjEI/dCiIVmXKyOib4i+t0VgLVpVFMGd/39XkkUUgpIIekpZOUONNbDxw==","app-plugin":"./app.plugin.js","_npmVersion":"11.12.1","description":"Headless Verifiable Credentials SDK for React Native - Pure logic layer with event-based API (no UI components)","directories":{},"_nodeVersion":"24.15.0","dependencies":{"bs58":"^5.0.0","uuid":"^11.0.3","buffer":"^6.0.3","jsonld":"^8.3.2","xstate":"^4.35.0","date-fns":"^2.26.0","elliptic":"^6.6.1","crypto-js":"^4.2.0","color-diff":"^1.4.0","jwt-decode":"^3.1.2","node-forge":"^1.3.1","@noble/hashes":"^1.8.0","eventemitter3":"^5.0.1","jsonpath-plus":"^10.0.0","@noble/ed25519":"^2.1.0","short-unique-id":"^4.4.4","@noble/secp256k1":"^2.3.0","base64url-universal":"^1.1.0","@digitalcredentials/vc":"^1.1.2","react-native-get-random-values":"^1.11.0"},"react-native":"./lib/module/index.js","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.35.0","del-cli":"^6.0.0","prettier":"^3.6.2","typescript":"^5.9.2","@types/jest":"^29.5.14","@types/node":"^20.0.0","@babel/preset-typescript":"^7.27.1","react-native-builder-bob":"^0.35.0"},"peerDependencies":{"expo-crypto":">=13.0.0","react-native-fs":">=2.18.0","react-native-mmkv":">=2.0.0","react-native-keychain":">=8.0.0","react-native-device-info":">=8.0.0","@react-native-community/netinfo":">=9.0.0","@react-native-async-storage/async-storage":">=1.17.0"},"peerDependenciesMeta":{"expo-crypto":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/wallet-sdk_1.0.5_1785431553028_0.7461849540513823","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["module",{"esm":true}],["typescript",{"project":"tsconfig.json"}]]}},"1.0.6":{"name":"@br.gov.dataprev.inji/wallet-sdk","version":"1.0.6","keywords":["verifiable-credentials","digital-identity","react-native","headless","sdk","event-driven","credentials","identity","security","DID","VP","VC","OpenID4VC","OpenID4VP","wallet"],"author":{"name":"VC SDK Team","email":"pankajchaudhary7121994@gmail.com"},"license":"MIT","_id":"@br.gov.dataprev.inji/wallet-sdk@1.0.6","maintainers":[{"name":"dataprev-inji","email":"alexandre.dekker@dataprev.gov.br"},{"name":"netlonde","email":"carloscomercialti@gmail.com"}],"dist":{"shasum":"4e81d5269ee879947cd1d5d13f597294a5b4af94","tarball":"https://registry.npmjs.org/@br.gov.dataprev.inji/wallet-sdk/-/wallet-sdk-1.0.6.tgz","fileCount":135,"integrity":"sha512-qhSL4D3+bQqs4vBJ1UTUp2SxSpTPc0KnMulm9J2qpB5ftcgtPc6v1Dx5GiG1w/g+IK4fBT9K0Yx6xrTbIiTYwg==","signatures":[{"sig":"MEUCIGI13yxVPt8+RTBtW5wcK/koi3s9XdjkKt4yua4JIIHnAiEAyD7heUcPI3lfmClwIPjKEI5mojI5mYsIya2KN+Jwc0c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1733274},"expo":{"autolinking":{"nativeModulesDir":"android"}},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/lib/"]},"main":"./lib/module/index.js","_from":"file:br.gov.dataprev.inji-wallet-sdk-1.0.6.tgz","types":"./lib/typescript/index.d.ts","exports":{".":"./lib/module/index.js","./polyfills":"./lib/module/polyfills.js","./app.plugin.js":"./app.plugin.js"},"scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","build":"bob build --target module","clean":"del-cli lib","prepare":"bob build --target module","typecheck":"tsc --noEmit","build:docs":"typedoc src --out docs/api","test:coverage":"jest --coverage"},"_npmUser":{"name":"netlonde","email":"carloscomercialti@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"_resolved":"C:\\app-inji\\sdkdoscm\\inji-wallet-sdk\\br.gov.dataprev.inji-wallet-sdk-1.0.6.tgz","_integrity":"sha512-qhSL4D3+bQqs4vBJ1UTUp2SxSpTPc0KnMulm9J2qpB5ftcgtPc6v1Dx5GiG1w/g+IK4fBT9K0Yx6xrTbIiTYwg==","app-plugin":"./app.plugin.js","_npmVersion":"11.12.1","description":"Headless Verifiable Credentials SDK for React Native - Pure logic layer with event-based API (no UI components)","directories":{},"_nodeVersion":"24.15.0","dependencies":{"bs58":"^5.0.0","uuid":"^11.0.3","buffer":"^6.0.3","jsonld":"^8.3.2","xstate":"^4.35.0","date-fns":"^2.26.0","elliptic":"^6.6.1","crypto-js":"^4.2.0","color-diff":"^1.4.0","jwt-decode":"^3.1.2","node-forge":"^1.3.1","@noble/hashes":"^1.8.0","eventemitter3":"^5.0.1","jsonpath-plus":"^10.0.0","@noble/ed25519":"^2.1.0","short-unique-id":"^4.4.4","@noble/secp256k1":"^2.3.0","base64url-universal":"^1.1.0","@digitalcredentials/vc":"^1.1.2","react-native-get-random-values":"^1.11.0"},"react-native":"./lib/module/index.js","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.35.0","del-cli":"^6.0.0","prettier":"^3.6.2","typescript":"^5.9.2","@types/jest":"^29.5.14","@types/node":"^20.0.0","@babel/preset-typescript":"^7.27.1","react-native-builder-bob":"^0.35.0"},"peerDependencies":{"expo-crypto":">=13.0.0","react-native-fs":">=2.18.0","react-native-mmkv":">=2.0.0","react-native-keychain":">=8.0.0","react-native-device-info":">=8.0.0","@react-native-community/netinfo":">=9.0.0","@react-native-async-storage/async-storage":">=1.17.0"},"peerDependenciesMeta":{"expo-crypto":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/wallet-sdk_1.0.6_1785842780969_0.9978804578941962","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["module",{"esm":true}],["typescript",{"project":"tsconfig.json"}]]}},"1.0.7":{"name":"@br.gov.dataprev.inji/wallet-sdk","version":"1.0.7","description":"Headless Verifiable Credentials SDK for React Native - Pure logic layer with event-based API (no UI components)","main":"./lib/module/index.js","react-native":"./lib/module/index.js","types":"./lib/typescript/index.d.ts","exports":{".":"./lib/module/index.js","./polyfills":"./lib/module/polyfills.js","./app.plugin.js":"./app.plugin.js"},"expo":{"autolinking":{"nativeModulesDir":"android"}},"app-plugin":"./app.plugin.js","scripts":{"test":"jest","test:coverage":"jest --coverage","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli lib","prepare":"bob build --target module","build":"bob build --target module","build:docs":"typedoc src --out docs/api"},"keywords":["verifiable-credentials","digital-identity","react-native","headless","sdk","event-driven","credentials","identity","security","DID","VP","VC","OpenID4VC","OpenID4VP","wallet"],"author":{"name":"VC SDK Team","email":"pankajchaudhary7121994@gmail.com"},"license":"MIT","dependencies":{"@digitalcredentials/vc":"^1.1.2","@noble/ed25519":"^2.1.0","bs58":"^5.0.0","jsonld":"^8.3.2","@noble/hashes":"^1.8.0","@noble/secp256k1":"^2.3.0","base64url-universal":"^1.1.0","buffer":"^6.0.3","color-diff":"^1.4.0","crypto-js":"^4.2.0","date-fns":"^2.26.0","elliptic":"^6.6.1","eventemitter3":"^5.0.1","jsonpath-plus":"^10.0.0","jwt-decode":"^3.1.2","node-forge":"^1.3.1","react-native-get-random-values":"^1.11.0","short-unique-id":"^4.4.4","uuid":"^11.0.3","xstate":"^4.35.0"},"peerDependencies":{"@react-native-async-storage/async-storage":">=1.17.0","@react-native-community/netinfo":">=9.0.0","expo-crypto":">=13.0.0","react-native-device-info":">=8.0.0","react-native-fs":">=2.18.0","react-native-keychain":">=8.0.0","react-native-mmkv":">=2.0.0"},"peerDependenciesMeta":{"expo-crypto":{"optional":true}},"devDependencies":{"@babel/preset-typescript":"^7.27.1","@types/jest":"^29.5.14","@types/node":"^20.0.0","del-cli":"^6.0.0","eslint":"^9.35.0","jest":"^29.7.0","prettier":"^3.6.2","react-native-builder-bob":"^0.35.0","typescript":"^5.9.2"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/lib/"]},"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":[["module",{"esm":true}],["typescript",{"project":"tsconfig.json"}]]},"_id":"@br.gov.dataprev.inji/wallet-sdk@1.0.7","_integrity":"sha512-zshtlPD+LLAicrUQDn+tpsy4TouTyLcmiDFSXgYYJnoPwufc3YQaRoXDxFxXsu5Rptnim3t7dTxXgRMd+ZXpmA==","_resolved":"C:\\app-inji\\sdkdoscm\\inji-wallet-sdk\\br.gov.dataprev.inji-wallet-sdk-1.0.7.tgz","_from":"file:br.gov.dataprev.inji-wallet-sdk-1.0.7.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-zshtlPD+LLAicrUQDn+tpsy4TouTyLcmiDFSXgYYJnoPwufc3YQaRoXDxFxXsu5Rptnim3t7dTxXgRMd+ZXpmA==","shasum":"f84e39631c3ef74975d825b2c5e5a54f0351a3eb","tarball":"https://registry.npmjs.org/@br.gov.dataprev.inji/wallet-sdk/-/wallet-sdk-1.0.7.tgz","fileCount":135,"unpackedSize":1712182,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDN6fR2tt8uZb3sVUXphWoAgr64GlPEjw20NGxXKBORNAIhAPRJDhpma4Cdz1ZHbsbPejOu9L383Mm49pEc5cmxyNqS"}]},"_npmUser":{"name":"netlonde","email":"carloscomercialti@gmail.com"},"directories":{},"maintainers":[{"name":"dataprev-inji","email":"alexandre.dekker@dataprev.gov.br"},{"name":"netlonde","email":"carloscomercialti@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wallet-sdk_1.0.7_1787842141824_0.9878360885288178"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-28T16:54:21.309Z","modified":"2026-08-27T14:49:02.196Z","1.0.3":"2026-07-28T16:54:21.687Z","1.0.4":"2026-07-30T14:29:07.505Z","1.0.5":"2026-07-30T17:12:33.203Z","1.0.6":"2026-08-04T11:26:21.192Z","1.0.7":"2026-08-27T14:49:02.016Z"},"author":{"name":"VC SDK Team","email":"pankajchaudhary7121994@gmail.com"},"license":"MIT","keywords":["verifiable-credentials","digital-identity","react-native","headless","sdk","event-driven","credentials","identity","security","DID","VP","VC","OpenID4VC","OpenID4VP","wallet"],"description":"Headless Verifiable Credentials SDK for React Native - Pure logic layer with event-based API (no UI components)","maintainers":[{"name":"dataprev-inji","email":"alexandre.dekker@dataprev.gov.br"},{"name":"netlonde","email":"carloscomercialti@gmail.com"}],"readme":"# vc-sdk-headless\n\n**Headless Verifiable Credentials SDK for React Native**\n\nPure logic layer with event-based API. No UI components - perfect for integrating into any React Native app with custom UI.\n\n---\n\n## Features\n\n✅ **Headless Architecture** - Zero UI components, pure business logic\n✅ **Event-Based API** - Listen to events, render your own UI\n✅ **OpenID4VC Support** - Full OpenID4VCI credential issuance\n✅ **OpenID4VP Support** - Complete credential sharing/verification flow\n✅ **Error Handling** - Detailed error events including HTTP 424 handling\n✅ **Authentication** - OAuth 2.0 / OpenID Connect support\n✅ **Device Registration** - CPF + FCM token registration\n✅ **Notification Support** - Push notification handling\n✅ **TypeScript** - Full type safety\n\n---\n\n## Installation\n\n```bash\nnpm install vc-sdk-headless\n# or\nyarn add vc-sdk-headless\n```\n\n### Peer Dependencies\n\n```bash\nnpm install @react-native-async-storage/async-storage \\\n            @react-native-community/netinfo \\\n            expo-crypto \\\n            react-native-device-info \\\n            react-native-keychain \\\n            react-native-mmkv\n```\n\n---\n\n## Quick Start\n\n### 1. Initialize SDK\n\n```typescript\nimport { VCSDK } from 'vc-sdk-headless';\n\nawait VCSDK.init({\n  appId: 'my-wallet-app',\n  network: {\n    baseUrl: 'https://api.example.com',\n    notificationBaseUrl: 'https://notifications.example.com',\n    timeout: 30000,\n    oauth: {\n      authorizationUrl: 'https://sso.staging.acesso.gov.br/authorize',\n      tokenUrl: 'https://sso.staging.acesso.gov.br/token',\n      userInfoUrl: 'https://sso.staging.acesso.gov.br/userinfo/',\n      clientId: 'your-client-id',\n      clientSecret: 'your-client-secret',\n      redirectUri: 'myapp://oauth/callback',\n      scopes: ['openid', 'profile', 'email'],\n    },\n  },\n  storage: {\n    encrypted: true,\n  },\n});\n```\n\n### 2. Listen to Events\n\n```typescript\n// Credential download events\nVCSDK.events.on('credential:downloadStarted', ({ credentialType, issuer }) => {\n  console.log('Download started:', credentialType.name);\n  // Show loading UI\n});\n\nVCSDK.events.on('credential:downloadProgress', ({ current, total, progress }) => {\n  console.log(`Progress: ${progress}%`);\n  // Update progress bar\n});\n\nVCSDK.events.on('credential:downloadComplete', ({ credential }) => {\n  console.log('Downloaded:', credential.id);\n  // Show success, refresh credential list\n});\n\nVCSDK.events.on('credential:downloadError', ({ error, credentialType }) => {\n  console.error('Download failed:', error);\n  // Show error UI with retry option\n});\n\nVCSDK.events.on('credential:notAvailable424', ({ credentialType, issuer }) => {\n  console.log('Credential not available from provider');\n  // Show \"Share\" button instead of retry\n});\n\n// Authentication required\nVCSDK.events.on('auth:required', ({ authUrl, reason }) => {\n  console.log('Auth required:', authUrl);\n  // Show WebView with authUrl\n});\n```\n\n### 3. Use SDK Methods\n\n```typescript\n// Get all issuers\nconst issuers = await VCSDK.issuers.getAll();\n\n// Get credential types for an issuer\nconst credTypes = await VCSDK.issuers.getCredentialTypes(issuer.id);\n\n// Download credential\nconst credential = await VCSDK.credentials.download(issuer, credentialType);\n\n// Get all downloaded credentials\nconst credentials = await VCSDK.credentials.getAll();\n\n// Delete credential\nawait VCSDK.credentials.delete(credentialId);\n```\n\n---\n\n## Configuration\n\n### OAuth 2.0 Configuration\n\nThe SDK supports configurable OAuth 2.0 endpoints for authentication. All OAuth URLs (authorization, token, userinfo) can be customized during SDK initialization.\n\n#### Default OAuth Endpoints\n\nIf you don't provide OAuth configuration, the SDK uses these defaults:\n\n```typescript\n{\n  authorizationUrl: 'https://sso.staging.acesso.gov.br/authorize',\n  tokenUrl: 'https://sso.staging.acesso.gov.br/token',\n  userInfoUrl: 'https://sso.staging.acesso.gov.br/userinfo/',\n  clientId: 'inji-dev',\n  clientSecret: '<default-secret>',\n  redirectUri: 'http://localhost:3001/redirect',\n  scopes: ['openid', 'profile', 'email'],\n}\n```\n\n#### Custom OAuth Configuration\n\nTo use custom OAuth endpoints (e.g., for production environment):\n\n```typescript\nawait VCSDK.init({\n  appId: 'my-wallet-app',\n  network: {\n    baseUrl: 'https://api.production.example.com',\n    oauth: {\n      // Production OAuth endpoints\n      authorizationUrl: 'https://sso.acesso.gov.br/authorize',\n      tokenUrl: 'https://sso.acesso.gov.br/token',\n      userInfoUrl: 'https://sso.acesso.gov.br/userinfo/',\n\n      // Your app credentials\n      clientId: 'production-client-id',\n      clientSecret: 'production-client-secret',\n      redirectUri: 'myapp://oauth/callback',\n\n      // Required scopes\n      scopes: ['openid', 'profile', 'email', 'govbr_confiabilidades'],\n    },\n  },\n});\n```\n\n#### Environment-Based Configuration\n\nRecommended pattern for switching between environments:\n\n```typescript\nconst environment = process.env.NODE_ENV; // 'production' or 'development'\n\nconst config = {\n  appId: 'my-wallet-app',\n  network: {\n    baseUrl: environment === 'production'\n      ? 'https://api.production.example.com'\n      : 'https://api.staging.example.com',\n    oauth: {\n      authorizationUrl: environment === 'production'\n        ? 'https://sso.acesso.gov.br/authorize'\n        : 'https://sso.staging.acesso.gov.br/authorize',\n      tokenUrl: environment === 'production'\n        ? 'https://sso.acesso.gov.br/token'\n        : 'https://sso.staging.acesso.gov.br/token',\n      userInfoUrl: environment === 'production'\n        ? 'https://sso.acesso.gov.br/userinfo/'\n        : 'https://sso.staging.acesso.gov.br/userinfo/',\n      clientId: environment === 'production'\n        ? process.env.OAUTH_CLIENT_ID_PROD\n        : process.env.OAUTH_CLIENT_ID_DEV,\n      clientSecret: environment === 'production'\n        ? process.env.OAUTH_CLIENT_SECRET_PROD\n        : process.env.OAUTH_CLIENT_SECRET_DEV,\n      redirectUri: 'myapp://oauth/callback',\n      scopes: ['openid', 'profile', 'email'],\n    },\n  },\n};\n\nawait VCSDK.init(config);\n```\n\n#### OAuth Config Reference\n\n| Property | Type | Required | Default | Description |\n|----------|------|----------|---------|-------------|\n| `authorizationUrl` | `string` | No | Staging URL | OAuth authorization endpoint |\n| `tokenUrl` | `string` | No | Staging URL | OAuth token endpoint |\n| `userInfoUrl` | `string` | No | Staging URL | OAuth user info endpoint |\n| `clientId` | `string` | No | `'inji-dev'` | OAuth client ID |\n| `clientSecret` | `string` | No | Default secret | OAuth client secret |\n| `redirectUri` | `string` | No | `'http://localhost:3001/redirect'` | OAuth redirect URI |\n| `scopes` | `string[]` | No | `['openid', 'profile', 'email']` | OAuth scopes |\n\n#### Security Note\n\nFor production apps, **never hardcode client secrets** in your code. Use environment variables or secure configuration management:\n\n```typescript\n// ❌ Bad: Hardcoded secret\noauth: {\n  clientSecret: 'abc123secret',\n}\n\n// ✅ Good: Environment variable\noauth: {\n  clientSecret: process.env.OAUTH_CLIENT_SECRET,\n}\n\n// ✅ Better: Backend token exchange (no secret in app)\n// Implement server-side token exchange instead\n```\n\n---\n\n## Event Reference\n\n### Credential Events\n\n| Event | Data | Description |\n|-------|------|-------------|\n| `credential:downloadStarted` | `{ credentialType, issuer }` | Credential download initiated |\n| `credential:downloadProgress` | `{ current, total, progress, currentStep }` | Download progress update |\n| `credential:downloadComplete` | `{ credential, credentialType, issuer }` | Download successful |\n| `credential:downloadError` | `{ error, errorCode, credentialType, issuer }` | Download failed |\n| `credential:notAvailable424` | `{ credentialType, issuer, message }` | Provider doesn't have credential (HTTP 424) |\n| `credential:deleted` | `{ credentialId }` | Credential deleted |\n| `credential:listUpdated` | `{ credentials[] }` | Credential list changed |\n\n### Share Events (OpenID4VP)\n\n| Event | Data | Description |\n|-------|------|-------------|\n| `share:requestParsed` | `{ verifierInfo, requestedCredentials, authRequest }` | Share request parsed |\n| `share:downloadStarted` | `{ totalCredentials }` | Downloading missing credentials |\n| `share:downloadProgress` | `{ current, total, currentItem }` | Download progress |\n| `share:downloadComplete` | `{ successCount, error424Count, realErrorCount }` | Downloads finished |\n| `share:credentialNotAvailable424` | `{ credentialType, credentialName, issuer }` | Credential not available (424) |\n| `share:consentRequired` | `{ verifierInfo }` | User consent needed |\n| `share:sharingStarted` | - | Sharing in progress |\n| `share:sharingProgress` | `{ message }` | Sharing progress message |\n| `share:sharingComplete` | `{ success, protocolNumber, transactionId }` | Sharing finished |\n| `share:error` | `{ error, step }` | Share error occurred |\n| `share:userDeclined` | - | User declined sharing |\n\n### Authentication Events\n\n| Event | Data | Description |\n|-------|------|-------------|\n| `auth:required` | `{ authUrl, issuer, reason }` | Authentication needed |\n| `auth:started` | - | Auth process started |\n| `auth:progress` | `{ message }` | Auth progress message |\n| `auth:complete` | `{ success, token }` | Auth finished |\n| `auth:error` | `{ error, message }` | Auth failed |\n| `auth:sessionExpired` | - | Session expired |\n| `auth:logout` | - | User logged out |\n\n### Issuer Events\n\n| Event | Data | Description |\n|-------|------|-------------|\n| `issuer:listUpdated` | `{ issuers[] }` | Issuer list loaded |\n| `issuer:selected` | `{ issuer }` | Issuer selected |\n| `issuer:credentialTypesLoaded` | `{ issuer, credentialTypes[] }` | Credential types loaded |\n| `issuer:error` | `{ error, issuer }` | Issuer operation failed |\n\n### Device Events\n\n| Event | Data | Description |\n|-------|------|-------------|\n| `device:registrationStarted` | - | Device registration started |\n| `device:registrationComplete` | `{ deviceId, cpf }` | Registration successful |\n| `device:registrationError` | `{ error }` | Registration failed |\n| `device:fcmTokenUpdated` | `{ token }` | FCM token updated |\n\n### Notification Events\n\n| Event | Data | Description |\n|-------|------|-------------|\n| `notification:received` | `{ notification, type }` | Notification received |\n| `notification:credentialReady` | `{ credentialType, issuer, notificationId }` | Credential ready for download |\n\n### SDK Events\n\n| Event | Data | Description |\n|-------|------|-------------|\n| `sdk:initialized` | - | SDK initialization complete |\n| `sdk:ready` | - | SDK ready for use |\n| `sdk:error` | `{ error, context }` | SDK-level error |\n\n---\n\n## API Reference\n\n### VCSDK.credentials\n\n#### `download(issuer, credentialType): Promise<VC | null>`\n\nDownload a credential from an issuer.\n\n**Events emitted:**\n- `credential:downloadStarted`\n- `credential:downloadProgress`\n- `credential:downloadComplete` (success)\n- `credential:downloadError` (failure)\n- `credential:notAvailable424` (HTTP 424)\n- `auth:required` (needs authentication)\n\n**Example:**\n```typescript\nconst credential = await VCSDK.credentials.download(issuer, credentialType);\nif (credential) {\n  console.log('Downloaded:', credential.id);\n}\n```\n\n#### `getAll(): Promise<VC[]>`\n\nGet all stored credentials.\n\n#### `get(credentialId): Promise<VC | null>`\n\nGet a single credential by ID.\n\n#### `delete(credentialId): Promise<boolean>`\n\nDelete a credential.\n\n**Events emitted:**\n- `credential:deleted`\n- `credential:listUpdated`\n\n---\n\n### VCSDK.issuers\n\n#### `getAll(): Promise<Issuer[]>`\n\nGet all available issuers.\n\n**Events emitted:**\n- `issuer:listUpdated`\n\n#### `getCredentialTypes(issuerId): Promise<CredentialType[]>`\n\nGet credential types offered by an issuer.\n\n**Events emitted:**\n- `issuer:credentialTypesLoaded`\n\n#### `get(issuerId): Promise<Issuer>`\n\nGet a single issuer by ID.\n\n---\n\n### VCSDK.auth\n\n#### `getAuthUrl(): Promise<string>`\n\nGet the authorization URL for OAuth authentication.\n\n**Usage:**\n```typescript\nconst authUrl = await VCSDK.auth.getAuthUrl();\n// Show WebView with this URL\n// When user completes auth, extract token and call:\nawait VCSDK.auth.completeAuthentication(token);\n```\n\n#### `completeAuthentication(token): Promise<void>`\n\nComplete authentication after user finishes OAuth flow.\n\n**Events emitted:**\n- `auth:started`\n- `auth:complete` (success)\n- `auth:error` (failure)\n\n#### `isAuthenticated(): Promise<boolean>`\n\nCheck if user is currently authenticated.\n\n#### `logout(): Promise<void>`\n\nLogout user.\n\n**Events emitted:**\n- `auth:logout`\n\n---\n\n### VCSDK.share\n\n#### `parseRequest(shareUrl): Promise<{ verifierInfo, requestedCredentials, authRequest }>`\n\nParse a share request URL (OpenID4VP).\n\n**Events emitted:**\n- `share:requestParsed`\n- `share:error`\n\n**Example:**\n```typescript\nconst { verifierInfo, requestedCredentials, authRequest } =\n  await VCSDK.share.parseRequest(shareUrl);\n\n// Show verifier info and requested credentials to user\nconsole.log('Verifier:', verifierInfo.name);\nconsole.log('Requested:', requestedCredentials.map(c => c.name));\n```\n\n#### `downloadCredentials(requestedCredentials): Promise<{ successCount, error424Count, realErrorCount }>`\n\nDownload missing credentials for sharing.\n\n**Events emitted:**\n- `share:downloadStarted`\n- `share:downloadProgress`\n- `share:downloadComplete`\n- `share:credentialNotAvailable424`\n- `auth:required`\n\n**Example:**\n```typescript\nconst result = await VCSDK.share.downloadCredentials(requestedCredentials);\n\nif (result.successCount > 0) {\n  // At least one credential downloaded, can proceed to share\n} else {\n  // All downloads failed, show retry\n}\n```\n\n#### `completeShare(authRequest, requestedCredentials): Promise<{ success, protocolNumber }>`\n\nComplete the share flow after user grants consent.\n\n**Events emitted:**\n- `share:consentRequired`\n- `share:sharingStarted`\n- `share:sharingProgress`\n- `share:sharingComplete`\n- `share:error`\n\n**Example:**\n```typescript\n// After user clicks \"Authorize\"\nconst result = await VCSDK.share.completeShare(authRequest, requestedCredentials);\n\nif (result.success) {\n  console.log('Protocol:', result.protocolNumber);\n  // Show success screen\n}\n```\n\n#### `declineShare()`\n\nUser declined sharing.\n\n**Events emitted:**\n- `share:userDeclined`\n\n---\n\n### VCSDK.device\n\n#### `register(cpf, fcmToken): Promise<void>`\n\nRegister device with CPF and FCM token for push notifications.\n\n**Events emitted:**\n- `device:registrationStarted`\n- `device:registrationComplete`\n- `device:registrationError`\n- `device:fcmTokenUpdated`\n\n---\n\n### VCSDK.notifications\n\n#### `handleNotification(notification)`\n\nHandle an incoming push notification.\n\n**Events emitted:**\n- `notification:received`\n- `notification:credentialReady`\n\n---\n\n## Complete Flow Examples\n\n### Download Credential Flow\n\n```typescript\n// 1. Get issuers\nVCSDK.events.on('issuer:listUpdated', ({ issuers }) => {\n  // Display issuer list in UI\n});\n\nconst issuers = await VCSDK.issuers.getAll();\n\n// 2. Get credential types\nVCSDK.events.on('issuer:credentialTypesLoaded', ({ credentialTypes }) => {\n  // Display credential types in UI\n});\n\nconst credTypes = await VCSDK.issuers.getCredentialTypes(selectedIssuer.id);\n\n// 3. Download credential\nVCSDK.events.on('credential:downloadStarted', () => {\n  // Show loading modal\n});\n\nVCSDK.events.on('credential:downloadProgress', ({ progress }) => {\n  // Update progress bar: progress%\n});\n\nVCSDK.events.on('auth:required', ({ authUrl }) => {\n  // Show WebView with authUrl\n  // After auth completes:\n  // await VCSDK.auth.completeAuthentication(token);\n  // Then retry download\n});\n\nVCSDK.events.on('credential:notAvailable424', () => {\n  // Hide loading, show \"Share\" button instead of retry\n});\n\nVCSDK.events.on('credential:downloadComplete', ({ credential }) => {\n  // Hide loading, show success, refresh list\n});\n\nVCSDK.events.on('credential:downloadError', ({ error }) => {\n  // Hide loading, show error with retry button\n});\n\nawait VCSDK.credentials.download(issuer, credentialType);\n```\n\n### Share Credential Flow (OpenID4VP)\n\n```typescript\n// 1. Parse share request from deep link\nconst shareUrl = \"openid4vp://...\";\n\nVCSDK.events.on('share:requestParsed', ({ verifierInfo, requestedCredentials }) => {\n  // Show verifier info card\n  // Show requested credentials list\n  // Show \"Download\" button\n});\n\nconst { verifierInfo, requestedCredentials, authRequest } =\n  await VCSDK.share.parseRequest(shareUrl);\n\n// 2. Download missing credentials\nVCSDK.events.on('share:downloadStarted', ({ totalCredentials }) => {\n  // Show download modal: \"Downloading 0/4\"\n});\n\nVCSDK.events.on('share:downloadProgress', ({ current, total, currentItem }) => {\n  // Update modal: \"Downloading 2/4: CAFCredential\"\n});\n\nVCSDK.events.on('share:credentialNotAvailable424', ({ credentialName }) => {\n  // Log: \"Provider doesn't have ${credentialName}\"\n  // Continue downloading others\n});\n\nVCSDK.events.on('auth:required', ({ authUrl }) => {\n  // Show WebView, then continue\n});\n\nVCSDK.events.on('share:downloadComplete', ({ successCount, error424Count }) => {\n  // Hide download modal\n  // If successCount > 0: Show \"Share\" button\n  // If successCount === 0: Show \"Retry\" button\n});\n\nconst downloadResult = await VCSDK.share.downloadCredentials(requestedCredentials);\n\n// 3. Get consent from user\nif (downloadResult.successCount > 0) {\n  // Show consent modal: \"Authorize sharing with ${verifierInfo.name}?\"\n\n  // If user clicks \"Authorize\":\n  VCSDK.events.on('share:sharingStarted', () => {\n    // Show sharing modal\n  });\n\n  VCSDK.events.on('share:sharingProgress', ({ message }) => {\n    // Update modal: message\n  });\n\n  VCSDK.events.on('share:sharingComplete', ({ success, protocolNumber }) => {\n    // Hide modal, show success screen with protocol number\n  });\n\n  await VCSDK.share.completeShare(authRequest, requestedCredentials);\n\n  // If user clicks \"Decline\":\n  VCSDK.share.declineShare();\n  // Show decline screen\n}\n```\n\n---\n\n## Error Handling\n\n### HTTP 424 - Credential Not Available\n\nWhen a credential provider doesn't have a requested credential:\n\n```typescript\nVCSDK.events.on('credential:notAvailable424', ({ credentialType, issuer }) => {\n  // Option 1: Change button from \"Download\" to \"Share\"\n  setButtonText('Share');\n  setButtonColor('purple');\n\n  // Option 2: Show message\n  Alert.alert(\n    'Credential Not Available',\n    `${credentialType.name} is not available from ${issuer.name}. You can share your existing credentials.`\n  );\n});\n```\n\n### Authentication Errors\n\n```typescript\nVCSDK.events.on('auth:required', ({ authUrl, reason }) => {\n  // Show WebView\n  setShowAuthWebView(true);\n  setAuthWebViewUrl(authUrl);\n});\n\nVCSDK.events.on('auth:error', ({ error, message }) => {\n  Alert.alert('Authentication Error', message);\n});\n\nVCSDK.events.on('auth:sessionExpired', () => {\n  // Prompt re-authentication\n});\n```\n\n---\n\n## TypeScript Support\n\nFull TypeScript support with type definitions for all events and methods:\n\n```typescript\nimport { VCSDK, VC, Issuer, CredentialType } from 'vc-sdk-headless';\n\n// Events are typed\nVCSDK.events.on('credential:downloadComplete', (data) => {\n  // data.credential is typed as VC\n  // data.credentialType is typed as CredentialType\n  // data.issuer is typed as Issuer\n});\n\n// Methods have return types\nconst credentials: VC[] = await VCSDK.credentials.getAll();\nconst issuer: Issuer = await VCSDK.issuers.get(issuerId);\n```\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────────┐\n│         Your React Native App          │\n│  (UI Screens, Components, Navigation)   │\n└────────────────┬────────────────────────┘\n                 │\n                 │ Events & Method Calls\n                 ▼\n┌─────────────────────────────────────────┐\n│         vc-sdk-headless                 │\n│  ┌───────────────────────────────────┐  │\n│  │  VCSDKCoreHeadless (Event API)    │  │\n│  └───────────────┬───────────────────┘  │\n│                  │                       │\n│  ┌───────────────▼───────────────────┐  │\n│  │  Services Layer                   │  │\n│  │  • CredentialService              │  │\n│  │  • IssuerService                  │  │\n│  │  • ShareVCService                 │  │\n│  │  • AuthService                    │  │\n│  └───────────────┬───────────────────┘  │\n│                  │                       │\n│  ┌───────────────▼───────────────────┐  │\n│  │  Platform Adapters                │  │\n│  │  • Storage (AsyncStorage/MMKV)    │  │\n│  │  • Crypto (Expo Crypto)           │  │\n│  │  • Network (Fetch API)            │  │\n│  └───────────────────────────────────┘  │\n└─────────────────────────────────────────┘\n```\n\n---\n\n## License\n\nMIT\n\n---\n\n## Support\n\nFor issues, questions, or contributions:\n- GitHub: [vc-sdk-headless](https://github.com/pankaj7121993/vc-sdk-headless)\n- Email: pankajchaudhary7121994@gmail.com\n","readmeFilename":"README.md"}