{"id":47337267,"url":"https://github.com/universal-verify/id-verifier","last_synced_at":"2026-03-17T22:02:25.911Z","repository":{"id":300757270,"uuid":"1007095078","full_name":"universal-verify/id-verifier","owner":"universal-verify","description":"Library to simplify digital id verification","archived":false,"fork":false,"pushed_at":"2025-08-21T00:50:58.000Z","size":529,"stargazers_count":12,"open_issues_count":7,"forks_count":2,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2025-09-25T22:59:09.562Z","etag":null,"topics":["digital-credentials","digital-id","id-verification","identity-verification","mdoc","mobile-id","verifiable-credentials"],"latest_commit_sha":null,"homepage":"https://universal-verify.github.io/id-verifier/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/universal-verify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"kalegd","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-06-23T13:04:41.000Z","updated_at":"2025-09-09T00:07:44.000Z","dependencies_parsed_at":"2025-07-09T13:26:39.664Z","dependency_job_id":"35ff2e25-405b-4b3f-80cd-d3779b643b19","html_url":"https://github.com/universal-verify/id-verifier","commit_stats":null,"previous_names":["universal-verify/id-verifier"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/universal-verify/id-verifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-verify%2Fid-verifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-verify%2Fid-verifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-verify%2Fid-verifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-verify%2Fid-verifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/universal-verify","download_url":"https://codeload.github.com/universal-verify/id-verifier/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-verify%2Fid-verifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30633168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digital-credentials","digital-id","id-verification","identity-verification","mdoc","mobile-id","verifiable-credentials"],"created_at":"2026-03-17T22:02:17.703Z","updated_at":"2026-03-17T22:02:25.866Z","avatar_url":"https://github.com/universal-verify.png","language":"JavaScript","funding_links":["https://github.com/sponsors/kalegd"],"categories":[],"sub_categories":[],"readme":"# ID Verifier\n\nA JavaScript library that simplifies requesting mobile IDs built on top of the new W3C Digital Credentials API. [See it in action here](https://universal-verify.github.io/id-verifier/), and consider sponsoring this project or least giving it a shoutout if you feel it's helped in any way ⭐\n\n## Features\n\n- **Cross-platform**: Works in both browser and Node.js environments\n- **Protocol Support**: Supports OpenID4VP and ISO mDoc protocols\n- **Document Types**: Supports multiple document types including Mobile Driver's License, Photo ID, EU Personal ID, and Japan My Number Card\n- **Security**: Includes nonce generation, timeouts, and trusted issuer verification\n\n## Installation\n\n```bash\nnpm install id-verifier\n```\n\n## Quick Start\n\n```javascript\nimport {\n    createCredentialsRequest,\n    requestCredentials,\n    processCredentials,\n    generateNonce,\n    generateJWK,\n    DocumentType,\n    Claim\n} from 'id-verifier';\n\ntry {\n  // Generate security parameters\n  const nonce = generateNonce();\n  const jwk = await generateJWK();\n\n  // Create credentials request\n  const requestParams = createCredentialsRequest({\n    documentTypes: [DocumentType.MOBILE_DRIVERS_LICENSE],\n    claims: [\n      Claim.GIVEN_NAME,\n      Claim.FAMILY_NAME,\n      Claim.AGE_OVER_21\n    ],\n    nonce,\n    jwk\n  });\n\n  // Request credentials\n  const credentials = await requestCredentials(requestParams);\n\n  // Process and verify the credentials\n  const result = await processCredentials(credentials, {\n    nonce,\n    jwk,\n    origin: window.location.origin\n  });\n\n  console.log('Credentials processed successfully!');\n  console.log('Available claims:', result.claims);\n  console.log('Trusted:', result.trusted);\n  console.log('Valid:', result.valid);\n  \n} catch (error) {\n  console.error('Credential request failed:', error.message);\n}\n```\n\nWhile this example does run on the frontend, it is __strongly__ encouraged to create the credentials request and process the credentials response on your backend. The generated security nonce and jwk should stay on your backend\n\n## API Reference\n\n### Constants\n\n#### `DocumentType`\nSupported document types:\n- `MOBILE_DRIVERS_LICENSE` - Mobile Driver's License (ISO 18013-5 mDL)\n- `PHOTO_ID` - Photo ID (ISO 23220)\n- `EU_PERSONAL_ID` - EU Personal ID (European Digital Identity)\n- `JAPAN_MY_NUMBER_CARD` - Japan My Number Card\n\n#### `Claim`\nSupported claim fields that can be requested:\n- `GIVEN_NAME` - Given name\n- `FAMILY_NAME` - Family name\n- `BIRTH_DATE` - Birth date\n- `BIRTH_YEAR` - Birth year\n- `AGE` - Age\n- `AGE_OVER_18` - Age over 18 verification\n- `AGE_OVER_21` - Age over 21 verification\n- `SEX` - Sex/Gender\n- `HEIGHT` - Height\n- `WEIGHT` - Weight\n- `EYE_COLOR` - Eye color\n- `HAIR_COLOR` - Hair color\n- `ADDRESS` - Address\n- `CITY` - City\n- `STATE` - State/Province\n- `POSTAL_CODE` - Postal code\n- `COUNTRY` - Country\n- `NATIONALITY` - Nationality\n- `PLACE_OF_BIRTH` - Place of birth\n- `DOCUMENT_NUMBER` - Document number\n- `ISSUING_AUTHORITY` - Issuing authority\n- `ISSUING_COUNTRY` - Issuing country\n- `ISSUING_JURISDICTION` - Issuing jurisdiction\n- `ISSUE_DATE` - Issue date\n- `EXPIRY_DATE` - Expiry date\n- `DRIVING_PRIVILEGES` - Driving privileges\n- `PORTRAIT` - Portrait photo\n- `SIGNATURE` - Signature\n\n### Functions\n\n#### `generateNonce()`\n\nGenerates a cryptographically secure nonce for request security. Meant for backend use\n\n**Returns:** String - Hex string with 128 bits of entropy\n\n**Example:**\n```javascript\nconst nonce = generateNonce();\n```\n\n#### `generateJWK()`\n\nGenerates a JSON Web Key using the P-256 curve for encryption. Meant for backend use\n\n**Returns:** Promise\u003cObject\u003e - Promise that resolves to the JWK\n\n**Example:**\n```javascript\nconst jwk = await generateJWK();\n```\n\n#### `createCredentialsRequest(options)`\n\nCreates request parameters for digital credential verification. Meant for backend use\n\n**Parameters:**\n- `options` (Object):\n  - `documentTypes` (Array\u003cstring\u003e): Type(s) of documents to request (default: `[DocumentType.MOBILE_DRIVERS_LICENSE]`)\n  - `claims` (Array\u003cstring\u003e): Array of claim fields from `Claim` to request (default: `[]`)\n  - `nonce` (string): Security nonce (required)\n  - `jwk` (Object): JSON Web Key for encryption (required)\n\n**Returns:** Object compatible with Digital Credentials API\n\n**Example:**\n```javascript\nconst params = createCredentialsRequest({\n  documentTypes: [DocumentType.MOBILE_DRIVERS_LICENSE, DocumentType.PHOTO_ID],\n  claims: [\n    Claim.GIVEN_NAME,\n    Claim.FAMILY_NAME,\n    Claim.AGE_OVER_21,\n    Claim.ADDRESS\n  ],\n  nonce: nonce,\n  jwk: jwk\n});\n```\n\n#### `requestCredentials(requestParams, options)`\n\nRequests digital credentials from the user (browser-only)\n\n**Parameters:**\n- `requestParams` (Object): Request parameters from `createCredentialsRequest`\n- `options` (Object):\n  - `timeout` (number): Request timeout in milliseconds (default: 300000)\n\n**Returns:** Promise that resolves to credential data\n\n**Example:**\n```javascript\nconst credentials = await requestCredentials(requestParams, {\n  timeout: 600000 // 10 minutes\n});\n```\n\n#### `processCredentials(credentials, params)`\n\nProcesses and verifies a digital credential response. Meant for backend use\n\n**Parameters:**\n- `credentials` (Object): The credentials response from `requestCredentials`\n- `params` (Object):\n  - `nonce` (string): The nonce from the original request (required)\n  - `jwk` (Object): The JWK used to encrypt the request (required)\n  - `origin` (string): The origin of the request (required)\n  - `trustLists` (Array\u003cstring\u003e): Names of trust lists to use for determining trust (default: all available)\n\n_Trust lists are sourced from the [trusted-issuer-registry](https://github.com/universal-verify/trusted-issuer-registry). Current values are `aamva_dts` and `uv` at the time of writing_\n\n**Returns:** Promise that resolves to verification result\n\n**Example:**\n```javascript\nconst result = await processCredentials(credentials, {\n  nonce,\n  jwk,\n  origin: window.location.origin,\n  trustLists: ['uv']\n});\n```\n\n### Verification Result\n\nThe `processCredentials` function returns an object with the following structure:\n\n**Success Response:**\n```javascript\n{\n  \"claims\": {\n    \"given_name\": \"Erika\",\n    \"family_name\": \"Mustermann\",\n    \"age_over_21\": true\n  },\n  \"valid\": true,\n  \"trusted\": true,\n  \"processedDocuments\": [\n    {\n      \"claims\": {\n        \"given_name\": \"Erika\",\n        \"family_name\": \"Mustermann\",\n        \"age_over_21\": true\n      },\n      \"valid\": true,\n      \"trusted\": true,\n      \"document\": \"...\", // Full document data\n      \"issuer\": {\n        \"issuer_id\": \"x509_aki:q2Ub4FbCkFPx3X9s5Ie-aN5gyfU\",\n        \"entity_type\": \"government\",\n        \"entity_metadata\": {\n          \"country\": \"US\",\n          \"region\": \"VA\",\n          \"government_level\": \"state\",\n          \"official_name\": \"Multipaz\"\n        },\n        \"display\": {\n          \"name\": \"Multipaz IACA Test\",\n          \"logo\": \"https://avatars.githubusercontent.com/u/131064301\",\n          \"description\": \"Official issuer of mobile driver's licenses and proof of age credentials in Multipaz.\"\n        },\n        \"signature\": \"MEUCIQDrmlcELKPJHKiwlb/90zNPoiweAry0tF+j/LA21wxlWAIgNIeWgJc3dijrwrjRmMjJwecxif4hMi87zD55k7DOLLM=\",\n        \"certificate\": {\n          \"data\": \"-----BEGIN CERTIFICATE-----\\n...\",\n          \"format\": \"pem\",\n          \"trust_lists\": [\"uv\"]\n        }\n      }\n    }\n  ],\n  \"sessionTranscript\": \"...\" // Session transcript data\n}\n```\n\n**Response Fields:**\n- `claims` (Object): Combined claims from all processed documents\n- `valid` (Boolean): Whether all documents are valid\n- `trusted` (Boolean): Whether all documents are from trusted issuers\n- `processedDocuments` (Array): Array of individual processed documents\n  - `claims` (Object): Claims extracted from this specific document\n  - `valid` (Boolean): Whether this document is valid\n  - `trusted` (Boolean): Whether this document's issuer is trusted by one of the given trust lists\n  - `document` (Object): Full unencrypted document data\n  - `issuer` (Object): Issuer information sourced from the [trusted-issuer-registry](https://github.com/universal-verify/trusted-issuer-registry)\n- `sessionTranscript` (Object): Session transcript that was used for decryption/verification\n\n## Browser Support\n\nThis library requires browsers that support the Digital Credentials API. Currently, this is an experimental API and may not be available in all browsers.\n\n## How to test\n\n### Android\n\n- Have an android device handy or run an android emulator\n- Download a wallet that allows you to create test credentials. [Here is one option](https://apps.multipaz.org)\n- Go to chrome://flags in your browser\n- Enable DigitalCredentials\n- Go to [our demo page](https://universal-verify.github.io/id-verifier/)\n- Tap on \"Request Credentials\"\n\n### iOS\n\n- Have an iPhone or simulator running iOS 26 or later\n  - If using a real iphone, make sure you've added your ID to your wallet if supported\n  - If your ID is not currently supported or you don't have an iphone, the simulator has test credentials preinstalled\n- Go to the device's Settings -\u003e Apps -\u003e Safari -\u003e Advanced -\u003e Feature Flags\n- Enabled the Digital Credentials API\n- Go to [our demo page](https://universal-verify.github.io/id-verifier/)\n- Tap on \"Request Credentials\"\n\n_Test credentials won't present issuer information, however the demo page supports using the trusted-issuer-registry's test data. Test wallet providers are more than welcome to add their public certificates to the repo's test data. In the near future we will allow you to supply your own list of trusted credentials to the library, but until then, c'est la vie_\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request (submit an issue first please)\n\nTo help others find this repo, please consider giving us a star ⭐\n\n## License\n\nThis project is licensed under the Mozilla Public License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funiversal-verify%2Fid-verifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funiversal-verify%2Fid-verifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funiversal-verify%2Fid-verifier/lists"}