{"_id":"@sphereon/ssi-sdk-qr-code-generator","_rev":"50-6dceb65f240e301fa37187e021c832c9","name":"@sphereon/ssi-sdk-qr-code-generator","dist-tags":{"next":"0.10.2-next.11","latest":"0.11.0","unstable":"0.10.2-unstable.72"},"versions":{"0.9.1-next.56":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.56","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"22d9f1a3c4e8b3cd58de013ca244898d7e3e91af","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.56","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-KLvmlXwh9vS+xsnyT/VJNcvrZBtmP1gZFAXO0c5wmSc4IV1/VuQxacjr227WAFknh3U7p4gCKIQKq4VRAB5NFQ==","shasum":"463d84b0acb403c64159bc430bea4fe794c3ef5b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.56.tgz","fileCount":33,"unpackedSize":50068,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsDB7UI20b86w2gzzSYG2AzaPF6QlDWcJ/1EDAteydcgIgCBjzAuT28RUbAbfkGjyaOaT8YAAobudnb0ERdXLp7zs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkFlGXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRCA/5ACarvNo4pdR8tkslXe+Y6chAg8a5f5Og/77H1KvarKlKIr9/\r\nfQRR5Ps3tWMF+f8TLy34J5VJ9SRWWHySzyE6LUKWf/MlL77tcwTQy/Z3xxSR\r\nDuHRX5Q+cX/udWqrIuoHD2BWLuSloPZLd/TmHcEF6NgP2r6RbuHGa6b8eCty\r\nOd232L4xTSxrR+ccjCwrkOL2nzEzd0HamcH9nw+ysS1KivvZCZXkQb4Z2Jbo\r\n6ks3sWIuJyN1hsM7gKDkjBXSxeZHyzkPX46B3gXFg/Xfh4cDwPH95En8ot16\r\n2Kk3Fs5f11Egp08Gc5gUHA/ctJno9hMnNb4OOgRCF6id/5BwEErN2mprrtbp\r\n6ePiLBsXiFd/UV45Q4md5Qq+FZm/LXXVvMiMzRKJD2gAL4ny2sSL50mDnmwc\r\nVDD4b1S4b8n8THb6baWUQjVANQQzGSz+qQcKeuBRnHK4xBbhC99FPJA693jZ\r\nr1dFhabv4lCjPrYQ8whru/RONzUAbejAYwDHzSTMWuRcDdnYmMT4Vh/IUvm0\r\nIWtRUO39Iqy+J9AwDbz5DQtucFCVFPYPn93P53VMt0meJD8ABqzwkApW8T1f\r\numWgwdpjAt6rm+dxDVup9VFZ3hB0Pp4Eg7fOgE49wiMcoKCXQuncwx3vnYUS\r\ntPr2EtvCgHEqenRKxxZC5fvy6aHhB1e+048=\r\n=MV2a\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.56_1679184279703_0.6205522509024002"},"_hasShrinkwrap":false},"0.9.1-next.62":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.62","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"867d15c0b2f2f7647eea939e8344c69a462466fe","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`. \nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [\n  ...\n    new QrCodeProvider()\n]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.62","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-6e4OY7ivbXgJR2I3F9Qqz+FSLSRsx7H/u32S4c8vpoFmwnlSh1t7rsp7oCSx3bmGDgS0GaFRRe4MadvDe7grxg==","shasum":"1bf3a8e8cb155c58b683917635d038759651c42a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.62.tgz","fileCount":33,"unpackedSize":50068,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsjgmp6tzP1LZ2XdSwjlkmj05drvr6fTv5BpHf2IBdNQIhAPrjZDLUQrnm+ZsZYB2C3ciej2W0/PtYlE7QHYS3wPsg"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGk22ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtyQ/9GcR/jBqlyc2JX6J6vrCQ4ymqxsPz0qvcmJTEW7Pt11rIUroI\r\n6O2crJzqHQzdg7HxQEZGkQ6WOnsoKEGSio9+RPGKdsGtKp4CZJnqbVo52m7L\r\nxL8p0Tlvm/4ncI7bL/0hz24IlLbCIJexSSKqP9w78NzG0ZLeUVkWBAlnNVqQ\r\nGMd89BDHYzhZf3fsZmysnGw+dSKUnGXirQvMNVR3e48nqIRU/Fh9qatSgA1G\r\nj6mWY9eveeVm06BWa96ql/E/t4GO3VFDBw5iHXfdYBT0MrUKvZVakz2+gakU\r\n8Mq2G0n4YyZJ2x1pO17F+8Qgqh/tt/tGMG5a7Nd89DHN5XDu1z51wsRl0mBR\r\n7O5PvBhMMJaPLb3lI2ybNFYeCgziOVkfxkbjs1VHZ/zXn2MPk4rttkZCHjSN\r\nOthMwuF7M0edpLaNUNKhnbMMpoAjHsAs91aybLDzq4R8t+w6sqw5rxPZfJWY\r\n3HjJna+d1EaBX1lsnNx/L39G6UKdWnWD86+C8FazytTWCMDoGpkPKL+r/Ihd\r\nyRumvuW/ubPA3oVIRflTNGFAWoGHYiFoGhzD/fyg/6XRWFemX9cm4fxYlTn4\r\nTNxseiY6IBXeeJjC62PZxwXrXIzKTzquPZfNrf6wG/3fyqb16rgE1LZgoNfy\r\nYb/gbAoac5Qrhe+QMOojL+ZJTV+CLO7emxU=\r\n=kPUY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.62_1679445430098_0.8915605178225592"},"_hasShrinkwrap":false},"0.9.1-unstable.66":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.66","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"61cb806b4909d593791158fee36260b12301d2bc","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`. \nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [\n  ...\n    new QrCodeProvider()\n]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer, \n}\n```\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.66","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-rIiLdBeAGaGgwMcMKnyVs0bxzCF+1wqQ53U7+BxxIhXswI1F9jZa/XwWayeoIRtU43pfbEKGROToyGfbmIIlXA==","shasum":"76895a5d77faf30aaa553066fc42987775e7ece8","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.66.tgz","fileCount":33,"unpackedSize":58400,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDggxKXHpIJuO+ii9Wtpk+v0sklrClmUQ3fo/CH7pduggIhAKivG9iP6LvNIiw8LJ/+2N4/IvrroqiDmV7S/l0ez3Zr"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGu8TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHFw//UM0f378GZWHhQKwSoMFmEGqwadMVihw6iRJySARs+J8bFndX\r\nSrP4YiHtvSYlCEIeGPJa5nBRPtqcbzn7gobHGp0ag8LNWgz9KueS78tDQras\r\nsTaD8f5xTiMMLCPuNa11BXCupZcvzvC3ORuZt6lNLY7mm0++5CjnV98ENZPq\r\nWKx3GOESjqYU5lx5yE7ycF68S/iUe9z+gFeDXQGo4ApBLoYFejRBoYxMF1fk\r\nsahWgaJvp0IRUJBRdVMXMFe3f0ERi9vMZIzzhKqWmXNqX8+HZawRqAijJ5Dh\r\n0ly8fqCD5C5T7jOExUmyYJRgJu3A1EhZDgEgASmecEYO7XmQvL4m6Py36cWw\r\nPx/5br4k+LGlGGJlw/sUFbfiwkOs0E8nfSHv1G9ftVO1gJed+ZybkZtDve51\r\nD/MEmCoeBzSSjJZGym07/133mjfWG+fAPA1SYQ1x+6C0pbwKDWJm0NAOHXn7\r\ndwLtIzE2Lri9cgiMBB6/exMrO6iv2rjFr1uNUyJ8uqcu2Q6Eoyd31mcqYviu\r\n2TEDsBZdHlfTWZk2hJ1djtfjtH7kqA7xtFIoo5//5BAiGHuhpqV/sa8WIwZs\r\n7DoEnmXHsa9H1L+or0stvhXeOVBcXaclnBN5tn/vL4agQegkvVLIEu15RRaA\r\nNjnwrRIry1z4hEhVjCkrLdCpLJFRNKXTSls=\r\n=FfVd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.66_1679486738652_0.3997384006787099"},"_hasShrinkwrap":false},"0.9.1-unstable.67":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.67","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"789c5070d6a1d4d0176243219ce4f2642e8d74cb","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`. \nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [\n  ...\n    new QrCodeProvider()\n]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer, \n}\n```\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.67","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-wKkjTBViZ8dNKAfNOg+SGmADMFaJd2fJrxO6LeHUB3RzdqGcphvIWPm1L/oyuHTq2mb8/r2fbvvNg/QpkIGOtg==","shasum":"dbb2eb787dc607bb38c70d0625b85c949f7d52f3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.67.tgz","fileCount":33,"unpackedSize":58825,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/SX6qgtUMT88+PAlo5SRyTo8zaNVSqhJWlQp44UOg/wIhAOD5tEEwyV+RDI6I0PjwVzjZ2XDto0ThbcTqnShnPxO8"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHBfkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorcRAAhg+VpmMJ/FBopNMwPNImUx+xM6bmTE6QGQa20+UBGxSBScTI\r\nIpHlR4iHZecApUEMgN7JTA4RdKxofrqDzur9f2sL9JXt7XWHlaEfWeuI2t0o\r\n+95ZUf1/ksAUp3DAsH/XWFKfc8rHbL4NI+D9tzhLT/U+2nqM7TVz4AvEY5aQ\r\nE8Q4xTtkvLem4RZeg8FHFKRPw/wEmUk3fI5QWjT2LIFXSSPpDeRJ7iw0uRlB\r\ng4jxDYqB/R9lxedaZP/t+GOmlw/CCUCH37rOant8RqZofNg8Yw7Ub2aeIfDm\r\n/kfikSQw75UtEyx7kbQKMp/LEpUedMhyODM0a9ULcKp/4QAgYJy2+8ADzinC\r\nBFc8bKbdlSw0xl+pN2aSEdb+sdsH/sUzVbiEyR1Z/9H46GndVVaiPDQY5Q63\r\nB3D6nEsJZvtLfmE46bYZeFpvMHlZVj0Ql6lmDncpi9k6dzM0nvWCvSpJD5VL\r\nLZ9cuVJAdfbjizOuiVGKUJo6z+VgDvOjL6aAjjuOb4hEjLjIrewSCA21nms8\r\nwzJY7os24bQm+7XpMJJHRUdu1VJ7IT7EjMvqfhTirIVgPcOoakCl10/34zV+\r\nUzZ+l0MBMGjDJrbZTm0TjblusU0b78ymmI42bQfJoByzJ2rk5jl49yjAyzk2\r\n0sdRC0gRNGEAA0yRbV0F4IvbQfNKdXiX7fc=\r\n=694x\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.67_1679562724690_0.6959179579148236"},"_hasShrinkwrap":false},"0.9.1-unstable.65":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.65","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"9f05c76e0ad11f5d2229b3ebb612e921a1dfd590","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`. \nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [\n  ...\n    new QrCodeProvider()\n]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.65","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-fUSPVgVG7q2YfEMCVfzh08jhKvDR4ySqcFVqxgxUKvEWpmIZDlU9QoWhWSkXEf5Rj0uJUYFQEcKbHfT44pB/8g==","shasum":"6e0ba958b6cd3c688d54b2504dcf2fe388e58b20","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.65.tgz","fileCount":33,"unpackedSize":50072,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXOr3QDRqQMaQieZSOM7UCx9WV4uvwma1guqzvX16gGAiAG3dMn0QwhUDoZHRXI/dOmzQ6PwCmMuMz6hM4J+bBiJg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHD6lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpnjw//az14NeZ4SG37Opoe2AYQB2F9mxAAewBYzxYMO5/BgUTTy57D\r\neCDbRxd/bUTzZJcxxsh2Fi8/NYOwpvRhoLX52n3d0DtY5vepbvhcGJpMzdil\r\nVBfCKWnuuOQxqLwdqyJXIrPl8oiCyo6g/MzU1LQ0C7XJe0j2Y77w3F/OmI4d\r\nnSAeCPzE/6xXlCoJAZmCTmV3AYjFAKAyC8A87hIeK2Vq5FANzop0Szv2h6jy\r\nsFOAQ7aGnFUL+S7j8eu99zNglxnEfz0gdpz3/dqZnKS52UOC7voHQl7Z+IdX\r\nkS5F9hleQf8BdC9a3ruN7LclaWGXJeDSz88iv4nnAobrj4OYd+p6bRux50Xw\r\nEzR53r2UDi3jiaziKDhrpuE14aPbwRtJ3rusB5MLw49XZM/JJpKTlS6nJPuc\r\nUaGjXVtRJCvdc71TRAdNXeLx8QKzZLuDpFhhOosqSTC0B2urh+0n0f6+89o3\r\n3p/e9cCICJs44sBNG7wYgCk2wGT67PPt0O2Yi56tc4isfE35aGGL4rhpXQEi\r\nAp6NzQBLanhcuiAM+2DGzKG2VDC1yV6rSlhyHd6C5KNA7U7mDC1jzzdy4vm5\r\nsLwZ6zD8oZcD6Lcd+I8qSV7PgOwb7HVPt11tCjl0WTjU9fIY35xU5BL20i6v\r\nSLNx9/WlFJbm4QCOj9Q3usZacfeMxRNEYyk=\r\n=z1nx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.65_1679572644973_0.8130952007351107"},"_hasShrinkwrap":false},"0.9.1-unstable.68":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.68","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"536366823b09bdb6aae23ff5d4f87098eac68ea1","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`. \nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [\n  ...\n    new QrCodeProvider()\n]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer, \n}\n```\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.68","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-UCopShR3fM511VGcEoZIWBh65XSbxbZciIlJJZsE3HZ6cx53Z0cWVFmKdEV8kC0cEEXEDpyYXuLyO9TBZp1zTA==","shasum":"0172878f3b180c17d32e2f1a6d78f5f94a4b576a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.68.tgz","fileCount":33,"unpackedSize":59558,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk2IvYAofmSXmusA5cCs92n4GTv3hnssDmmjC0yMFKQAIgKNiuiMrQVGO1UG3aCT8GgLQqcYQF2DXEEU5sz5fKZAc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHGyZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo24Q/+L3SQV31PP62p6Gd370V1+qR4XdIm0dgXqqvwpIRTAwqWMAf9\r\n4OYWnUhW1OS7gfMtOBFnCisYADUxFZY7HbO7lo/8GMPCwkls889Sch6lUkNl\r\nwB1200gQ0eR3rH2xVflm0mUGb7i5PAMRfBP9lKA0oG66fW1yw1cX1nxcK/Ty\r\nLlbItl4/1va5G6KBpziyAlu+kXhiEmdjsL3mr0InZOauUAY/J8vmmN2/R1e+\r\noTmsk0Plg45sW/Rzul7u3iGBlAhC+fkTPZ2TWajxUJyL7oILvdKWpctJwBiI\r\nCCaDAW1p8FO0znS7+5sn6RMz6ActVMeaiQ304emUTMTRencEOLQwTAdJQIMD\r\ni0zrO4bOu90tdQM6N9z8K+nxdw0j/bDMRZSWSLG7MuUnc9ZxVUrXpCSDX6dM\r\nnD0zl/eRMHpPGzBivocjVSXwHf4m1+kpmeEVln3g+CGmWMA/z5BuG/tAKLKy\r\n+ZsuMwx0iEhoZIRlApBLXRjPS+3HMbsb4HtXD06ZaTdsWn3c+CDIyolyd20b\r\nDSOtkM2mbcA14snsIbsV4zlIRXjWoK3foc+bcb4irGZt7Fin3Oyhe2x6h471\r\np6DJhpPQmpGiRNqVUlhH77gy7R0vfV1jDcqrh7BGT0G8WBfIrRn3mNAF/oK6\r\nrUO6owEI24M9xxq0REgLvB0Ktyh9ToabTog=\r\n=hgjL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.68_1679584409012_0.13168895441545758"},"_hasShrinkwrap":false},"0.9.1-next.69":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.69","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"d229f07072144fc691a1e2dff575a7113373495c","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`. \nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [\n  ...\n    new QrCodeProvider()\n]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer, \n}\n```\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.69","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-jJQPMfZovERtsvwDTqMiLxz776SgcmN4ERpbpiDoYuqQXSUexyu9tK0k/zxWWMs6zTC2X5spyh050RcA90/bQA==","shasum":"071d84f4aa4d53008f7ce1d056196a5411541f97","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.69.tgz","fileCount":33,"unpackedSize":59554,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBksYMQriDSLP5clG6RM84CWVbF6MCkHK1ZbNIiPvCJdAiA3iMyk++dmT3pL64b91BtKNahykjZmO4YLheQFoQYuXA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHZCNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpStQ/8CwnuaIhT2YBLA3WeTNd1R+t66tJZ/IGErbuyfSJzDu/+KyZJ\r\nrYgvvt7QqNzfGmxIzhsH8bQRahRv83My33NhXS0FcDdVtez2cWPNfBp/EcGU\r\neS7HHSk4UAJszoMCGv/Zrbj93CnU8Jush9O1SwDOul2+HKwt21xRbnzudahj\r\nqar5ClghgRUppVO8aTyS828sZeEf2xz/h6rjC5gE8qESSyQR+smKu7tADKPH\r\nyUqgAsOaXsd54UrCSYkUXXx80kOWMXrVYIxfWYptl4Bn05/jwlgAiPrestsP\r\n/4LOP+GVtCA1Fsty3t73jBdCM/HeM8PV3o+ga9vqgYAqDjR/skurnqIvoJrj\r\nnm07L1LxbqW55Xjw+JMhwM8c9tvmXgyK8VyohQYfqPlnkGiZFBNBkWZhSN4X\r\ne6CTkhPSfH3YjhSEiZvieYnJu7i3vCUm6lh/XHFEsXkAt4uVZxwJ7aNjM/bH\r\nESbVRac3iX+VQZErwycMz6JmLPbx/vBTXuoqWEnAe0pzeV8bwzr07pJfgwLp\r\n0lSIXiVFOePR1dMPKDQGDn2bk0BlAx5ls7Yk244Q7zKC5kV0dk/jy6VpHUKm\r\nsTzocos64Y8HYoSEFZFe3EqFWm4DUpxVuCeHJOFY8+UrzMpeAQdsIZCId02i\r\nUlK/QV/Muk1cwkN7WbIqr1gTFMYqMsqjiho=\r\n=HnLQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.69_1679659148823_0.09886737058723027"},"_hasShrinkwrap":false},"0.9.1-unstable.85":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.85","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"2a31791523e2053c51f99bd5f3bf66304d8e7268","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.85","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-2b5p39sxOLYN2pzOSwIRfe2SHmNm8puyqhiltX/77+7foXOChAwZlgB8UCULLrN3i++TVypqdwAfJDJ5Qpe4jg==","shasum":"3e153801a640d54c730e7fc02f5eaddeb4c4a1d6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.85.tgz","fileCount":33,"unpackedSize":59546,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHOqT1OxcOTrIUD9Iowu0CK73QjvawvTArRNNjqevdMRAiEA20GyRbnXZNNcqhf9JjS/TVUQh+fmmpqOOmZEVaPzY9w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIXTCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmro7g/7BUzcz2R8Kn1NpbDNWaZOBtdCPaEFJpoZ1cwMTdx0V86c+dn/\r\nX1vxYyCYJtOyBbFo6rLfnTUd+IfguJ/7hAIOTjhQvlvU4uFtnlhGh+hKCbBF\r\nL/U0r2QxvC8m/nYvLD0tixsE+4LcT/qyUK7A2JX2ioh5VfactoFaQ60yinq3\r\nSQEH54RpiAjx9A4VSjzUVergdD7Oe8v+fy1OWt1QIO/EkGCTkPSjyVrLQCi9\r\n4rxb9pa5iFfdMdoaXCv0N/5YYM5+4ds4vDKPmA0Icj36NAWtDOZeEaM3lzs8\r\n+mv6QCLCqS3c5AK09Cvuv3j8Ws8LKh7fr6DGD7TNuU/4s9MG1oreO9On/pVW\r\niB4yGZvw1RexiMR7841Nvmk0MZUZZfO4yuGh2pf2Rq46Sv9P/RImpWohKWPS\r\nVQjMq2Tt47+WumZWlYA7UDNxynnBW9qe5Zjo2JfAF+C6OxPj+jBw9V4O9wLl\r\nXQns+vvgFlFVlfgXM6P4Fq5TE6vUCEZfCdU/sp4uFuWa5XmrgnlgUm7HPAG1\r\nObKqlIJH9o8mdGMgiZ+C+1Fg4ptbdP+omqHKSgCmMTe+hX2aiQUCIxvAZ6QO\r\nmT9pUbv4EkRn/ZEbOpcHAJYnS/VmLQqg4pYsu+riaUnAxJlZ3/6tQ7iwGzRR\r\nG6P4r9aNKzbpejg0HXFthLlpBxiWXWSUm/4=\r\n=bYCe\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.85_1679914178648_0.772893574928498"},"_hasShrinkwrap":false},"0.9.1-unstable.87":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.87","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"fcacce8a15dc0d1555c57afa143c25116bda8224","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.87","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-gnmTMj6QHmFoaPqo/fOuibq4nRUpKneyyCNp8dADweUgntleKxXRlcaxtfl6OQPcA2oQOjZoGyLd8fVzFAkexQ==","shasum":"f87fac77d6bcc5e2e4545ed2308da40437a0de98","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.87.tgz","fileCount":33,"unpackedSize":59546,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID31MrWqDZxuoV9LIE9ISQCI8C6MAHuLtaSqOKHwz+IeAiACtOWhydPor2IDsjoYCjtyjZF3wXLHQr0L2RW/L/Yx8Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIYd2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFDw//c6TPNEjcz42op+70tNu4EXYjr8/ZzDxPc8MSP/aXfa8GPufu\r\nfwfHuHLfOkLD1fJaFnG5PntdiWGjOHLG2MA+o0dgyArca7GcmA1S5BPi5Uvd\r\ncIrAYD6axxRq6B2c8T6hwQwI0vujeoLtQ/dN6y99c32zofN89Q5Yqm/H7a4m\r\n+hyn+Axq9mds2GON1luUci0wKgTYhYI0hjH4jXJi7rfowR971J4v2x6toM45\r\nfMr83RepoPsWMIhuXnkrASGn/SoX03ctnsYLNofYaQcZ83f480rcqNKQz+Hq\r\ncYc4yxsL9Kae7ZXmOtCg6A+3ePPHu8XRT0uCh0aLmB2m2FAYDFB9VgNXOtjH\r\n6HFDZevnh1miwHG99g0JQqOWImE5VKFJrIdTct9VlHUohRY2bwOEKYTXTS77\r\nwH+3r/izCUMpU55YBbJN5OqNXSBVbZ12dEdLv9JfNlzeabUlHY4S5iQnMyr/\r\nzGDm/Sooqp+h8zmPggzjvYFOowfZ7OXjIwsWnvufalsiTOyqMxewvWDqMf3f\r\nNeX0hgg3hnsTCwoxXR4UDiEIwje5o+j0jYrdgWTnbUQaeSIbjtFR7KcqZy/b\r\nJSAibsvUyq0M3CmaCMTyy90y5qgPEO/dQQ9YEN7OMI4TIm5eDWEnptxXqj61\r\nECRhmapRFrG6yg0E70/CgNFQQIIsL4Kqbuw=\r\n=uM+D\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.87_1679918966255_0.9517523819619262"},"_hasShrinkwrap":false},"0.9.1-unstable.88":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.88","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"bc20d25d9b58688fa745e6e1020979ad936025c0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.88","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-3PQwCRV2rVy7lRLeiZziYSWPhgMw9C9tpd6Fmdxb8IUFvN30DRG6Yau3sqBR3L1oFoO3PWZobH2tyjAOjevBYQ==","shasum":"0ec842aded4764274726f54e2a6739c4f732d2c6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.88.tgz","fileCount":33,"unpackedSize":59546,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4q6FEm7uXExaMSVTaG+OiQPAbMu2WJ9BnqVVjfXIifAIgJICo7xNATZKNYxLMOZPZ7ejiry4tCO+EfoyqoTxCp1w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIYgRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFSg/+PzwKvwVY46TJNA8DFcdqitthUMT9vjB5l3dliEtqZQmf6tWN\r\n1xby9JA4Tu0z1x+QINKVJguTuT1w8sxEyPFolpkf+HmJuYaWnFuiK6txhMHq\r\nsZhn+lVIyElAXa/oMfBqtVNTTGoWBseVlQAByOhm5VCBjSgHW7lUg6Wuc/47\r\nFrulGbL3SSLvCtCAKJNzIOj8iTNoXHxTxonm2iozbEoEmhF/tffamnd/kBtd\r\nnzYqxA29ky9pWLGWMarar2WkUnjhjUixpU3UN7DnaL4Og4Yk9YEK530omxOU\r\nYjAVqUii8nU8xy3FMzmY84nAafGCe0AwYeGbIvYijIei1oo92XgHuPxBPR6r\r\nsr+jiUgTPfA/JSFdD28r7m7ggMOAN9oPE4yWFHEwIj0rXWjk+qmkLjPcTtQ+\r\ngGz+nOZdPFLAO62nXyr5XLB/Cskg2xE+ZS7wI2XuNnGVAkBcj6D3w34dzRq+\r\nkDh7Qp3beMNauoznVkRugdMbFU8veFHJFUjZIMvTpF6DEFtm+//XCL22Ecbj\r\n6MZaMj6Ku4HQg2Fad7V44zvE3xZUvua5vkNKRoMvs6ZPmy/t5GjljwP6MlB5\r\ngR6LuPH3LI6n587493rN/yBp4z+nLuBKoExY2tQ+RpJTlTatgAH9uQpWdiDj\r\ng1JPKOHuoReYMuojJSl3nfL3x1ixGZ4i9Fc=\r\n=xNJj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.88_1679919120961_0.3854818089523451"},"_hasShrinkwrap":false},"0.9.1-next.89":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.89","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"163fa09b8b1dab08dd59e07ddd28d4d0802fda5d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.89","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-1izmO0I/Dr8CrkoQj+HyW0A4ygJZU13TfUPX+JKGpW7mfooa/cK8DP9WiQiKLAlRFEXD8qtathzvfGu4CB5k9Q==","shasum":"ebc102cc7092481f9bf9c17ac1f90da922920e71","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.89.tgz","fileCount":33,"unpackedSize":59542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZ9XroTdx3UvJHY0WPkNvZY+bFWfBBZpLfbIFRmlnGeAiEApp7v/xNfDbl7N2w5pvgBp0kDguC4L+itpmeluoGEqdQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIgvVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZ1g/+IAndrfPgDsib7bXxBkOnlJ2xrebFFTsaqyd+b6lIo0JRBqCt\r\nWiJY8rZAgx4RmK/3rLvAFj1rHu8p+++Ks7f3/UBsf6kbLfq2P4OQSI4V+F5W\r\nJ+42ytQkmQLX3SEjDLjKa5IZ3apbotZjLMBvPL0bS/wv3nW8i86GvRHGsfVh\r\ng73ufLCjQBrHQs2txoYygMb2l2O6gGXNejaLyYQSBzQvDk7LQuVe1XKSngw2\r\nwighY8Icr++2MpNZJVn3BaCFQvGVZxvdcjGjEFv6Z5LCvFTQGg+E9jN8prai\r\nY51bL+TZMdFBdJ7OOQ9Zfpiz+4FuGalK87FO5gV1Nx8H6QGieCGXj93lMt9z\r\n9z4JgUd6zORL3hoBR766zxkZuR9DfphN8fyqM2Q9BdcskRa7RHpL7COXrF4o\r\n7+uo3trKlS7QwD4jTILhEhzSwOAlD7f+p16KfcYNBW8II7xPE5WHt16Kml3F\r\n+Dg5JZTvdEeq4zNdjrncyA9hJ+yqAMUn4Jc513r2v4P0R92LbFY28psPWHAi\r\nRNd5Q/2zKxrVSLijeTXBnBA16xD2Wvia06qnqq38O2dH3CEaYSWUhDkVsL5w\r\n5QGrpgZr/jhVkZgYEH7Byc2SytoLLDvOXoTvk7xGErXsQvBr8CjuOklMd+2G\r\nrxN5XT1bTIwdr2CcMpCNt5j4y1ze9zLMIN0=\r\n=/IVN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.89_1679952853283_0.4967671639508746"},"_hasShrinkwrap":false},"0.9.1-next.96":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.96","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"2aadaaac883e78141d67ebb8e8a9dc3574a0da78","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.96","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-FMD3E9l9LXdP28PjBWE2MC5YYRfOslKSSOe/+CmI5DccB+8Q2ylw47V6ogs2taLMPr9hdtTF6HoRQ7Yk959+zw==","shasum":"de224140b029e198e057c757389ee617b7dbd906","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.96.tgz","fileCount":33,"unpackedSize":59542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMeUkAVez2oeNgEza67qCHB/GmS8FuGVrj5we/yiRjEQIgHPqads7uBKgYdIBeaeioX4/WhM+/fL6Pj5cbQ55hozU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkI/+xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5hQ/8Cb3REeGDCSyoPXvLLdt/aIRecp70sbVBHuOc4VjtGAKQaK0k\r\nkxhAWukYL52KbsfL8+ILMe6d9KIR/z+gT4M+rLCcNuIvy7y01qvFw7Nu8SK7\r\nB9XI+vDbFets2nFLwcOtWAqWrVV9pTAtEHPCHOFG9+AmyYsFkvUile45zzxa\r\n1drX4yL6V8ElqyPK5brJy/1cxR7W4pVHz1fSRG5BE+Vi0xYQBV4aJsruHbY5\r\n1ZYduv0ppmBaPcJ0ed1Hh5ch8BDL+7H3SIB9Bne8UjjF9gI1ILqGWxULeRC8\r\ndjTFxQ/i3eY8EMPDVIXXva3Zq5FDtlBC3Y7xWDB3sPWOLEX0U8VQiLOEMg58\r\n3NegJentcebvM3DlzXnChMdM0B6eBxFsdhYA84fQFTCs9gVeIgmX6DxOViIs\r\neHMXyHA2GbRoe+l1fbUu8ZBLpTvgJwGrBfpAi+6ibMzStB4igf5nBueyJdnA\r\np32Herj1+fu7gy8vuSGx2CtUGBvscndggMhtf3npXzPzMpRTNlYYgCdaS0IO\r\nO9NyCOsBvDF2ghBktjeJ8OyzhhFexyNF6rEA7p6BN/SmerXr6378itKTat1F\r\nGIUp5UlzWaBQsNO4HwxBBO8E914krsebvyjlJozRJBF2S/lU6G6AOeThoT4e\r\noSoBSt3L9GZg0suQch/kUKjB3d3sRAueXjs=\r\n=VI0D\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.96_1680080817710_0.23299516025459965"},"_hasShrinkwrap":false},"0.9.1-next.97":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.97","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"c75ff124dd85cd4e19e536324fb5a8c8dae4910e","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.97","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-0Fp4ddByOpcNmaS0sTeUrhqD2yhDN6ZIniZlH7+lDBuFFFnNsHuzRbvYxSk3gF50vYOnsN674QYuYSGLE27URA==","shasum":"ac53dad92db42de5917995944ce133412f92d330","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.97.tgz","fileCount":33,"unpackedSize":59542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGCz+6dk1aZoxyWQjDgcfWKpULo9hJmIdfOhwnid5Ak6AiBJrMdvQHwKK56lm/ff/yrR4uqknnsTEY60uBcRH+tc8Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJJAsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7gA//eo8Q9dOwRZ9cxgtGuoUh/G6/tFULK8ZuBX1TEMOzxCycr10v\r\n4WwMxdR+HfPQWKLzKWt5CRSBiQtvUe3Iasp3K/ao+k7CWC1bZk/MSyp38jXb\r\n4ENqqsFMkrQ2pQ0TarFAYm7xRtoB+MQ9ThtmWOdMFjdinc0ePLeN0FPgr4rS\r\nSuBOTTveMru2f9sYqVuu34FsV4jVnIZ7x8C1jG76/U37ZY38+G1kmKy2i1Gi\r\ncBT0LQgNE5B0DigMeWOpsze+/Tk41B/wcxwjPO5EMgCVz39baJJn64ANkzrC\r\nZOMaUrutT/4D2zbqxmOQqhdipjbJuOSJlhasP0UCk7zA9/2BcP69YwM/PZid\r\nXkAdMrtCNj5ETvAoppaE7bSn4LdoG1lpSyxFYVM1Z69UgxfIiQDM1ipVkGrX\r\nANbrQPlWWPsR6mahZB5r5LvaaUy+1CvxW7dHU/bqEFoZldspRGLNL0wYI8uO\r\nMI4APZ6YiQOzripgX7d5M4HrqbXQH8qN9NNoN5lqXkIN5gPILr93FTpo2/Cr\r\n12JW5zzSmUFK1BE3P2LKqq7Ry4kMcfcKWy2HP8IbmHzauRcejM/T9nqgOTDL\r\n7O+h4fhQeWnhby7THUfjF+YAFtAR655K9Maa01/Y0DDF2SxHNjzJDYxKERPV\r\nmMFUaNpIIVihLaB3334AOZqLkn1qLQCpEk4=\r\n=16IF\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.97_1680117804774_0.889063136304513"},"_hasShrinkwrap":false},"0.9.1-next.99":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.99","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"7c555dccaa9c361efc4516f7cd5e8583ca07a146","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.99","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-U9GcmCEb6xJw8sY2bhlYsn+N0gpt+Nhia24W9nImpleI2oqLjg742HIlKktUZx6itcewjTep+1sc24rO/JUDWw==","shasum":"43c8c49837c4b3cddc02b334c5934410e90b0401","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.99.tgz","fileCount":33,"unpackedSize":59542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHi8QWUzelWaJwJt2fJ26DFiw6cQ/HNYExIq7mBEK2BzAiAnYdXsPxSexL2j09IR2C9REScI68hQ4MeVHBNnYCBCkg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJJDTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6Kw/9Ed1AZ8nHUbMla/eqpEQ3dhEeRKwtoGSYsMLY3um9PEtJKuJQ\r\ntwa7p2dZ1xmYtURXjC0nx+Ar7WS5pgmNehoI6zTdTGiIR3FNVkzKSu9g1PJw\r\nBVCWbQ49rKPIXV6ybvR3kckUkuydoz2Rz1Qwck1POBRFwsW0w7Fhi7S5m+hn\r\nvRih3xP+rvfunla5Blj5RVbzo58n4wFmH4aqDfboOEC8HlW/Jpaxnta4vf+I\r\nHKn2AdtbhqvGX1CnwaNuKPqdlpAxPEOx9R0J/ke7B1EValhDpNWY3DJeLOSn\r\nrLWey74lx6Z2Ylpz8NvvP2CcljlK8LmJlGB3NNrOKojhi2pKvBDxNBUamHWj\r\nn2H3/j9aLTtz8AkG3Ckaif4MI0DhnG6qN8gBlSVegyjDgDvypC+BQ5cwk7SW\r\nMJT1wZt2E1zaDQTacTSZ3EXQfx9QnRKy9wajE4L83GjE0BJvdmu1vzYscDO4\r\nXAovwtmpLuMIPgc16ydXUtijYopKM54KbvXu5zEqGTHjZ2HRZ8/a8bQkaNGw\r\n0EE2eGVOfBCuvPKpIaXAUtC5zM3FjUhUTuo8STdhK7+C0Pw4GYP6gTjfcPWw\r\nDNOz5LQ21Qx1bvraTkF5KoyY3bxbZfdvc25W0Dhn9mR++Ty5pJqj2sz87KFz\r\n285y1mIXIHhzAJVJmsuA34JyO0LZ2UcEsiY=\r\n=xVAW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.99_1680117971531_0.9653104612692709"},"_hasShrinkwrap":false},"0.9.1-next.100":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.100","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"d77ff412cb9da4de9e5932c82e1eae142a083172","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.100","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-c8KabAWSh78y3p0GHKv9F79kGAs0NjXqLkjquK9XaT07rw+akZOQpFCwWWNsoY5DzVSB3YUkLoPpxoRKvB9PSA==","shasum":"153f86094df8f5a94bace850895860185cdcf0a1","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.100.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7IU+PpPn3JGU/heOoA9yVTDj8EnBTGdgfCGf6rb0HCAiB8WvPDAC/0yv2qcC8P/P9W6YaEqVvACChF+ige86gOIQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJJL+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwMw/9H7qJ7jIoCuINQgc44qjmLYPM4257JnUySumO7mfNQLsQz7nq\r\nnmlvsHL55+9NzFt2z6chmxYhMvZtQMh73u0zZVGJ4iVw3Ia6bdYWVdZ3WQzY\r\n+uMOSbEVr5WwOJs5JwQYFEI1+wusfdf7rteyNe03JttVMkTGFkFVlnVU2gax\r\n53t2rcLw2WAKsIRFjr5ZopZdKpq1DXWHfAbZwOaJ7HmDKjSNEwcvj1w4IlcI\r\nCRuoc8CHQ8rMRloRA9TasiJ2CqOVGoUbes29hcREveohjIz/PfDVBJr9PYSl\r\ncQqqOVKRzJ73XkqxLiZiN7UxBdzk+erW4EVZ4VzXEnXZsBNp1PKgPOYcxx04\r\nYCZsMFYWJWOdaWWzVjgEFnlK4NDeju868yKyc7GYJ4FOC3CyN7bkzDQovvq1\r\nDSaDAH2uKBiy8iaFKVIb+gbJTQkSo4RPKSzo9dTYIAfVRMqcM3bDftSlGGBl\r\noN1XVA9DuM2RtabPW7R9whdWnP/FX9Brjx4H/HgLhMQjPAhKqzaIhjOzYWRk\r\nmtCn2SxW+Ic9QOKFS5LmjkeZY2WH8AIO80IZTGSimkBQequ6KCRqBvV3qm84\r\nU1KaP1Q0YovQFopa36AzglZnZOAWE9bRAKhW9MUA7H0ZU6E1q0NzTkPdxJEo\r\ndLKwIeelqsUoNEq3UtjVpfeaPRqINOjwoDc=\r\n=CGYo\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.100_1680118526726_0.13459291405503948"},"_hasShrinkwrap":false},"0.9.1-unstable.108":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.108","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"321b68279f487b3abf210edf82dd9aa41006b255","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.108","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-yEZ03y950wyieYeB+yvxVPu8KJh5ZytlhONARHUkN0nQXnc882zfK0Zw8lhNAvDFmrYn3/hdXh5AsZrG45n5UQ==","shasum":"93992b7b724455e3c2742e2b1b4af962dd7a7c88","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.108.tgz","fileCount":33,"unpackedSize":59547,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqYiO9FRjnZ5SVBG8dPsU37IH4nM2seHvAd308/2m5MAIhAJ7+EmL02mp1LQ4HdLngjAZN02aQFtCR6wwCfUJz3VAm"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNz1OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyGQ/+Ps6mXKuirLzboHN7Y8S9bsVsAAnUj/BfPTaDgdBplwXNqkoj\r\ntnL64LiRvSyUWTVSSwbYTt0ebvsaA7UCQ/XC+QhhaiOpqkXT/PQSc5ZrsXCa\r\nOAr4gRb5734F3ymGghzXUS1ABJvTkVAamP7QEoRjGo6b0D4obQemucDKBoUC\r\nmRrKIuhYLvSmYW0WNwWBYR8mmWPjhJj3BrGJ1x+MglzK0nQq0e2OOsmks4fM\r\nluSKdOBkcBPfgfgg+DbxE7OvzsU06XIVGCuLqu1SU+dcIaynpNy6FBqUKbkK\r\nd8e682RZCnTIwUPa/tYsHhWa8pz4A1QBjB1rUBdeVxKsFe/aIHd8cKplxYwC\r\nZN670C0v8LolIpDrFr/6qX//I1JybiEqynJxTgG96H8/EDAI30pyaoO4pnR3\r\nUSaDfv1mgzOBFzZuMzty2P5GpCQ/n9r9jERNBcjZFriyDxQgVdkRO0sE0bcA\r\n+YSpNPZIWtaJYRHVf6HVOvFiF/EpmRLNYrY7xM+GgSo7FqZMhB/uSBk3OE7l\r\nLolKNQ5sOTRNGM21hDMyj50WxtsY+32to1UXooFTHP6BIrFr+tjsnaFyJeY8\r\nUOVPrOpBDXgGQMqdQK3ItwQP3uyw8o7+QDDz1gaA1tt+imz2y8IEkfpFSwwT\r\n5AUxfw7AqdnUzY4NeKKeXjOYamwDZw484ic=\r\n=R52k\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.108_1681341774540_0.20200142939030208"},"_hasShrinkwrap":false},"0.9.1-unstable.109":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.109","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"db2213ec08f5d44a9e39c619ef0b5456155f2e0c","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.109","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-PLLEguZoy6fCg6Ai7GgvMOc50ItGvTxbvyQrCnAZwxB7LuDvNWn044JUU0s9pKCdMAhV/KNFe5u4a2YA4pwXnA==","shasum":"ef7ef572d8c191d09995cbafecf8522f8c10bc98","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.109.tgz","fileCount":33,"unpackedSize":59567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDU0gdp+uJEzKPs+s8CRTZNGmrE9dKogGT52dheuK/bhgIgb2r7567B2eZbXownc+yGbMErjxaScedEXTmKnE3eMqE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN0HoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmov8Q/+NqXmpLH2Q/0+S58CkrKTiDrPYXCvEB6Un1Yg26DfjN8Rkl+I\r\niaBXy4twnP8kfDFn2uX1PR6q5+RuiCMQd2Ug7K44jKHJjHyDjmABkMOB2jrs\r\nq1T1mz63T7mkiXmQ5PInkS7fgg+MKXisfUwuwL3+6AJV8A+4Foh7hEfaJXyJ\r\nCWRqD6mzj7m1nY/DlEXNhcc17iwqhTgmRUkeBfXF0NnuIy/cwPyBJ2y0TBfj\r\ntAB3NfFw/RVrmhZtsm9e1zVDGaxnKSZm6Eos8tDXH/KUNlovmAvt2fvSM17M\r\nUro7X/AG8ioTgy2p3sjF/u/1bG0CA0ipjfLzsMSeYTYPmVLLTAu0Mj8Pxgg+\r\nirticDS5Us/OtzVPn4nHrfepm9oHwC6qhHgM798Fshq6xnduM0m54iqguIwb\r\nZlhYn2PSTVvnL03BkgWUKzPLNCzC5cXoAxusOPcl3p1X/lyBBBW99qQ3N5co\r\nSJgaPWsL2jPwr+KYU+QyiE4g+Xh9ReyT5AhntsP+x0KK4ncuaBRmchdYMsuu\r\nuTgZOJDbCFAWPrFB9QEgwdeXvpkDTEIL4yho6g+z1InkQMRAIbC5/8RzkrT/\r\n1spGQA3Jxr1Utyp35O6fuhaifrXNiiKZHA4H9iR9yUDpNXANhxWV7VQLt4QS\r\nDIaBjuyQe5TvpTJes2Z657Ixj01bFSu7QZU=\r\n=mSTQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.109_1681342952091_0.6077798829635381"},"_hasShrinkwrap":false},"0.9.1-unstable.101":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.101","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"fafa982bef719986aacce61ac59d2cba1685744c","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.101","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-mbI1fSZJcWNl+sIb9w1wb+/7uHHHd1V1lFbd6trviIUyNWLjCu3LDZTrdwMdiwr7BPjVOxbZcQdOIhHDM2AwEA==","shasum":"0d32eea11233c982175516cb9b0bb9afff61d434","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.101.tgz","fileCount":33,"unpackedSize":59547,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICeg+IfZlt+M3Gq8df8xoTx5NWX50QaDGjbmjg/qyiCsAiEA6rYyLxuJ9X6sBWmNs0qb3guINZ7ZM0Mvx2SQI6cM8wI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN89uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQ0A//fNVJf7+Jh5abIM/CMsqby4bSrxxk911cxCgQHQdxCc8cXOd4\r\nn/hYzt9tRYeGwb7dyjjS+83eldD0uKI9JwKo3pGAfl1Mn62CI/patWTIcmMY\r\nHEGEk3iquQ9G6scV5EpWjewbIfT63HZXyG2WpxNrtV1UWS4YSwrtmC48aWU6\r\nj2JWQvPuEX7FMmOR4Ce6ueuAn5bP/GgdGDzwj+w4UohWOMiC1fc//IGvQpjP\r\nLd1hCOetIQD9hiJlVIB8gKol2/FdBR1XCBxJmLK5FPAf8j2I17pUeHQGwl3U\r\nuAkqEpBu3f2h04n9hFcsKv/V3LCJJO+Sdd4+panfSNT16qFve+91bizRqnpb\r\nYrWTo5yyW+K7NswEKj/590PSDh/kBtPGtxNQti1rFq7zVFrFeLP4Wk1lUr/c\r\nCWpr5lXEXAdY+zjGYchxXm/44ZWxJXgVnw1L5ZL5FYk2WtndEydKS5U737s0\r\nYWEX/4zvrcXaqVIeCI9ziCPNY+AATsr3y/1AXaxApyrUt3fSKgWnjx5EhqTs\r\nPQvJRIbmPZ/ApfU6/rMej66vQpv2phpl/MJBURdDt0rSJTCJ2N+1EGy1rVgk\r\nKmnUvos4m8rrsKyxwfnSI1NhoCSQ/d5gTaf8Jzv6PtIJvE7vB+Zeo65ty5yK\r\nfXZUnOWEUzEflEGAzmL+71P00774MdTz1As=\r\n=DGWQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.101_1681379182213_0.4373501191792648"},"_hasShrinkwrap":false},"0.9.1-unstable.112":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.112","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"b48f38d804083f4278f146e286ef05bb557baa7a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.112","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-G0bRR3ZEnPeS0zpX2vKMht7xvJpj9JcT/kSDAxugGG77C2uNyqeOH9S1UT/uFBQkyILJtVCHBXJGukoVB0RSsQ==","shasum":"c208c28ec7cd470c9936ff0dad51d076f4986893","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.112.tgz","fileCount":33,"unpackedSize":59567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGGcXuBpDPYGPG2pY6MOtc18Naaa/skgXdHZNnsgyUeAIhAOt8g95/lBtTZnPb1nTawDSoXRVRuDpQsBB07bweDNce"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOB44ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqp8Q//aEaq3Nd3k0h1GUusG2PZZW9PMbIvX4W9MwYm79N31B0PGNrj\r\nXnYu0sN798CgzfqPzZsCWz95h4U6G1FK9L/4fwcVrd8waY126UFOfxE4/8hT\r\n28E8DOrb6tNlVvkLT+YEvRGieYF4pkinX4RuQqPDTJ7QtUFeaHV+cgg4oS/j\r\n2bfA/j04RDGYAX6y3mftk71GU07+g72eUGJxuTgeeC1h3FwNEoC/vzbCKzoe\r\n+LpURku58nYip1XWB5q0qtOcdd9V0eJIfcWzVKfQGNj//qs/R8cu/JLDIjCU\r\nAMBBYGLkhyyZGQkJ/mDpfkmut/T4o7Sacvh0FzZ0f4zwFCauev+WlZ+tCTnX\r\nIBWtI9kkvJ1C51BUqYJCLapEtBD5iMuC28ASV8MAfNk4lQyFUldRw8kNdBBr\r\nqpu/n1MbncinWj1zBTa6aGD83Wd0D2HMU9DuAhXWTzJTdCT0DCR9o2vXMZTh\r\nDsTpstwepePl5L6qOe+rzaltzSCSFUi0bXEy/Lapanj3x1EsjNUbEWzItxcQ\r\nHBdQw7p/9okRuqBe/+a9cusu8YbeMVHvtGBDAHdGZh5BfdzQySjQHLiDiZFZ\r\nx6+Ppeo+o6NuD/pqxzcq5qqfl2wvkossUYQ8YaZPmnzDyVPGvHg8x/e/gZXN\r\nzUiWfO1P5xRrhmm4YzhHrSuGjhNQi+JLsPA=\r\n=H7j9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.112_1681399352441_0.9854675291449169"},"_hasShrinkwrap":false},"0.9.1-unstable.113":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.113","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"1a534cd5eab80a1bd697856e4a240fd2f30fa86b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.113","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-TOyIUcl0J8ja2m6ErK7eTfDKyTwrh4jEhN1Sq0KpzBLglrQ2CNGhM7tJuy9Wt+RvwZzerhmhL1llaiGMGBMAUQ==","shasum":"a69c3d07bf42ea6a95daf32cb8f53f901a55df7d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.113.tgz","fileCount":33,"unpackedSize":59567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDE9rZpftkJHxKdqSIGjdFglUF9IkqntInmyjD8K89wQgIgB+BvPx8FLkw0AlyppExHNFsCFFJ3HP/yejyO37eHaGs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOCJcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVJBAAoYv1Nz3ZoirSlLhq1pDrsSpnvVr72zuE9fkuI79UZtpCwiwL\r\njDG6reyR6opjdwnnYh/9f5u1OmFz95M4rFItzXwiaAZhjQf1EvIA/YLKECd3\r\nVKiEz9l+pH4LQk2E7pUfrtNfCNGdpkiJQ927oI/94YShZNRzJy6+I6W953zL\r\nPI5kDWKLx4Z0WkzB716dh01Twh6g+tmj4T/KAKXVz0aGItJ09Oh5FVEdhvMg\r\nxtHF0OPDQC/k6ieRj+mKyZvWQ2UhQKEq9KzqgmoGVwS/YjcbfyCO/VETa+Jd\r\nXOwgUKKSJU152cKld6jL0NAl4CaRcgolVAOwi0TfTzl8smpBHHXZKtXS59Py\r\n3qkPKWnYiGmUS9Kca89/4RMrR/3JMjBWUE/eFAWQJe31fLKFA1FrX6Yi5EZm\r\n7Q3XAbXZpG4TynVLWHJZ9CqNajh4oLAB8tjAHbBm8NuKVlRzfENbqoguILc8\r\n4iZbpoxrF3wfSuGeyHq0mC7Y2VMkGadGXJt/V+ChSBSGFFudU7MKSqDyugLR\r\nxI00Po71qF2Z/jVRT6vdsL+veAToF92EtQ+FG2rMlvP0ChTQOm0D69V21gVs\r\naVA6zkxHJKKF2fa0urw1LZNiusUY6RIKatyKYPkIy1qjOUaOhDJhxVo9zIWe\r\nSLt5fJavhXTfmHEDiBu9kK6BTH3Vp15DO7k=\r\n=WGRl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.113_1681400412317_0.9425924479594416"},"_hasShrinkwrap":false},"0.9.1-unstable.114":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.114","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"0fd92c10ff980915bd64d10fee08dfae8b0e179d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.114","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-GwgbSYzLpQmI+Le7RuECgHlP2RhQYLL+TlhwOlaWcfeZCGsvv1zOIjDJL9f0qeSdn0dhzsHBVru+mynmj18fvQ==","shasum":"768bba040c1ec340642c49f8b2e3511e4f812b7f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.114.tgz","fileCount":33,"unpackedSize":59567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHC52mWlQOVwsDWIZYZSudBGINIc+FtvP6vOdQdHtsPtAiBLTD9jkswZ+csVoZWSOMU2dpDcuhEZ9v6iaPCOnEzZgA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOGk6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoO3g/9FPywfsG3QLeEiOF8nW6P4NE2ytiRVoSuYQEStyLc7ViUqzUA\r\n7yPX2ylEI6b/nkc208A+99lMSbOECaU4JZwg+rD0LkHbFT0CJrw+k3YVVCK9\r\nlPshLl7Xmck1oy5qIenf2yOUHke3Zi0LWWQ9IiXCO2cys7EzNjZZLQ5GJRTW\r\ngNpDKncEX0aqxLfaouQpQwQCOLG2RFSnJlgxZdNUWni3oayHxFKQpnZ2px+D\r\nMTuU4K+6phpwf8E5HJlphxXFHDvYAkkKw4pJgTsr8c61NzEiRHv6D7x4LylC\r\nck5rMGvhEDKt5/IG5rGjfm6X+WWOHTxeoGYG2I6yrFQ5pEzkxvF6xZpjLHG1\r\nWPua2P8nuiyr3AtOpCwjsNSrucgyXcbre2OGSNFX2J2GAioCQI05QDD4YAYB\r\nydgvblewkRSIhvISenw/OLy33szKOOXXYy7OZjzz4geuytzt7xMIomYCKinL\r\nvbB+EM/kEZsFyj3GpRNM+sCLpFV5cQlHNj9tY90o2UyUVzPYmLaV4r8UIzaK\r\nOysOovp+DLvyO/f3MVJRNyckRp1NRKz7AtMoJUNBCqd+Oi6ygO58iCghv1W7\r\nVCQMo4bWD4AXd0KeEnTO6+c2vOIGhdDKLQBUVhhrTSUR9QUokezR75z0qUHI\r\ntXaFYJqGt5ZUvZgaHMbiCFSOUamJGTbuAIo=\r\n=cDeD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.114_1681418554311_0.8123788569424504"},"_hasShrinkwrap":false},"0.9.1-unstable.116":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.116","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"31f99e9f3d13f979adaafc8fe46a6bd6adf8615f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.116","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-gnbGuJcpZA7qGEAvpryz1na4Nn2D1c59Fiq5jGxRv75zRAzpLJFTEAuI+OaRZW8gLgPMhB8O0CB7cT6uWJ525w==","shasum":"91b0b40737d60c6a3cc9e333ce774c9044b98f45","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.116.tgz","fileCount":33,"unpackedSize":59567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8tuWqcalhYPST9/cuss7BDdEzvUj0OWbLJzr/q2Ms5AiEAjO0tG7CN1j/W08aaHENjw+mDUXTmb8vwHQ6oia/wZVU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOIrlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGRw//QGUeQG3elz3YgcvixX0wc1b3Ua1SPgbvkr15xlrTXAcFTxbB\r\nVnl9vbH+un/B2HeSbmY33eqVVX8QQJA9GC97J5S+iU4bg98HGOtzbRLFkuen\r\nLfgM1vzesHRUbLonldj2XAV4032fRAI+S32Qot6LWtlTl3EO1MMuWVB7Hkn4\r\nQ644n8YMJCGQo+SIC0dE2wt6bn/yO093IyrseOMO3ICfh29zJDhUIkNdBxR6\r\n5iZ2ATfP6qhIbglTdVLqIhLX9gVfb84fqRa8JpbVbvCNt716547qG7x6lZVd\r\nOLSGkHk/spwxlQvnaj+Q7T/89dG/YuStryksRnOX9Io9BxGzUGxfkbs63VW0\r\nYOtz3pplHiqrbPivjZ5auEjmmFwo3UuSVUDthUjsJAP9KAlSx6QvFy2n+GAK\r\nSnZHezBMAqHYOTBeUwlswdjCPYCxmKqCF7ds4y6fjHJrxjmH0uWWFYtYD2Wp\r\nRIJRI+0DSdGWrCojdEhY1+3h/aQO6aR3kCPpxralzqODp2bq3Ru2NScGXVmM\r\nvKos/XrfE3QADyMWyilz9+w9C9sVz1z3G2v/1Totq7H0z39LZEaox+BqOZGc\r\nRymSzUrLWvq6JnyXK5Iskte1GgCW9gTcKodvgD6lBSovZHlwBcIe/wRoyrF5\r\ndD4CzOlaC0ft5Rk/1mcqUMoKwh40oETPjBQ=\r\n=Pl/U\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.116_1681427173594_0.9112539190275324"},"_hasShrinkwrap":false},"0.9.1-unstable.117":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.117","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"6425e4f9912043dcc6a104722e184a91d47e8048","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.117","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-KH7Lbox6WcxnHULv9+ukCLP5Iy+bae4WGlsWRPMhd5p0qULtIv/+Y+9xFv1dzy1K4MaP8PuaLPKqGAtec1N2ug==","shasum":"6a058ce9ddbf6c3c0e17d8aeaf45aa2a0317b70b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.117.tgz","fileCount":33,"unpackedSize":59567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDB9rXZofGUJ8Zr8uDlOGeVRubyn1h3ZwcS+NYG1GA5DgIhAKLWWVGIjfqGww4ec0+frvfEaK1boXi3BK86rcFi3rAs"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOJ61ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRnQ//UZSGOvblGtFQ+dynFBDwe3Bw3NWrvVCCguis4Ej9irdEpWHj\r\ntytSFtoov5JlWGa5uy44kNZ+DJGu9OyZ+xdYhhy+0QwFk4WZqHl9+e7i40L+\r\nfbo7VlghhSK7NDJcx1rAb7mnUUncHBDV4iKepf/34SSRzeS8I/yPmv9Ya3/n\r\n/RiTPi9+GtDAesFDEmdZkMuPXNEkTFhOijM5QZF/pBFijM/0xcCrQX7447ls\r\nXMixzPAIvBz1+7+uS/oy8e3DtF4sI71aQO8SDIIKv617fNwqNCVqmsW3w151\r\nu+klqhf4v9rdU+m7YUOB5txe6Haf+Pv9dNNKXOZIFR3vrXpFJYzdkAKUgTH0\r\nfWxngURa0u2C+tJorJlOq0GSOmFBxYrwx9/oN4BSmLiOEUBrF8BXcBqtcXRl\r\nRnyR6c0GjcoX93P1tCKHzWYY5VCn/BXUZDeM0gAdnsJuIZRdMbOvKgjanYLl\r\nIoOgR1ooSLOmtbk/Y1pjuDey+Khc3OSfswaf6yIwJrd3Uj7jNArawyc55zD2\r\nZe8YawnhxeSU6yAsTwLG7MFDqSUPw+l6/O6MAd/UBiMvI5uggETFR6vADZZv\r\n9zRPw3WcZNpbu1/5YgyA0pWnjNCsnA2XLnnv+pvd5RJnuO+kV8DHy8UqK4fB\r\n7/UT8pQ1n+j06ArZSzi6AMpY+aJXjh96LiQ=\r\n=JQKM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.117_1681432245497_0.05694321440376804"},"_hasShrinkwrap":false},"0.9.1-unstable.102":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.102","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"21fe47b972573ef0d1bd27ba112bde191716895d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.102","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-Q34XGNWd5BOwFCfXl/FCIfqTdeHPzjawmpYldaUeZ3jkH2EdrS/w2X2lppDSWxwD7MoSwgwxcK/cV/C/GdsakA==","shasum":"640fb4b9f1bfc7f6a1f8ae33f8a836ff0ea43fb9","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.102.tgz","fileCount":33,"unpackedSize":59547,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAZbVydmUIrFT2fSUmqhbFkv4kTtl1BC/p7RuBQ4TbBKAiEAxigzmOF3CAbTYxdkAPDNR3XRR/WC+fGs33JW7TsLx4Y="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOVH5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcfA//aEYNKhZdhmJDQRHzeJGzcbBvBiEPAD258lm3IlyIA4o+96Pi\r\nZ3+jWnbGDkm9j+rUMnmQ8S6M2ZOBjZVle0zWCFNaY8j403vDxXqej/EX2Ale\r\njZe0NUHVVnDnX+l0ANFqF7kWGNgO88Y56rqpleaD6sPyvItGB08ykTYPbDIg\r\nIo6gAqMY65TxV2hljb5WH/Mln4WBc3Yl2WcD+Z+3hDjYhWfLoEjs7mz8yoUb\r\n16B72ACddYemm+BSYBr0J1WBgpFALkihNlA3gIMXMSWxTrGxM24EuRUl8ohe\r\nl6N+v8Co+47/QqCkCxOkUyT4POfkF18rk6ofGh/ZbjACCv4EjuVPm//byOP1\r\nt83AM+vTnScBXWRCU6LUeHmp/mWd3+DHWroRBepPBXc2Mb6z4xMxe2mU8oBW\r\neJwMtnK4tfL9KgBGtRazKaC40v3ZPUe90sokl1OJtvDrla66L7cJedjf6qkh\r\nFSsgQwXyh9+++JarM3R8rHiQe5Ia9nFY7Bf1oB/M2D0HKLs9JDUQJBNe1Uia\r\nKWHi7jTH8UQhCGxbKyyLkhWAEzoGrkIDe5q54YjnXSQonP+SHGk2BBC4cnEi\r\n5vHtxrjXMciP1aXVx0hCFqRkvXba9eQez/0zJlj3Ocpu3LIrsDt6DBcAgp4n\r\nOIByWOISA2ftIe/rtP3sGji+VgxdcT4ZOE0=\r\n=fNik\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.102_1681478137315_0.8301109224274543"},"_hasShrinkwrap":false},"0.9.1-unstable.130":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.130","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"975801e1e6c8270fd470acd7e2ce67ae4971a16f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.130","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-ZUQq46Ai34V3p9bgdjE250zVbeGut6yHiEDaAd3H4fJCcaH6GEYhsLusy7jcrCaULa7Lt3Zubgr3b7G6+wyqNQ==","shasum":"87d1f75ea4caaf50a350f7feef539dc9b0d00ed2","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.130.tgz","fileCount":33,"unpackedSize":59567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqd46yS3rBdLdDecE+UGx3PamdHi1yFUCeHDwO5JGjdgIhAPEbdbWjvyU8unPoNnYt0sn27f9pUTbXevGqxYPv+hrK"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOWThACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHZw/+MHHVxDt0Au5BkgvJrTPYlfgrWx1Ik+zFkto0nubKk+KqQmKo\r\nfBHRTosENnsMQP1QJDeweExubza3trIobCssPmtOapFXHWRjBFdKKyh/n9m/\r\nKXG6tAQ/MvER0X7/NQZPfrh3WlIWpKDFgJFT7me3AuMYZUkVhp1DYA1IbGTN\r\nM7GaGKP7fDT8GRSN22sm+058qOFt54BVrlBsfXDAkC3spyMU1Pkl2VPN5lsI\r\n3jXR27XirUM0Xc8q1MDzvsns1H72QqphsvPwbKDzyrR3dpWba/ltgcNNiA96\r\nvTLQ+c1BH4D9H/9ExfuWbRLB/5q4HJ7B1hX45LIVy0Ao+a0fgaIO4646N/Bv\r\nuZUuUMIxlCq78IIS3OomzRuu9i7cgRzX8gLZ4S0AKDZhOA+5SIT0s52OthSG\r\nen7cIrTNSYs6DrZyQWVZJBbyydBKFjjiyDiOPw5Ny+sNOR7UG0vt8toMdu9N\r\nMjg04Ytbb8Avk63R5ovJfb6OnZvbYN43OsfWBXvV4HQM7GO0CknmGkhvc4Qq\r\nD1f9Ng0FU4RzwVfWXgKbhcU56UJ3UBYLZCj2mVkAGnKzGnIee9Ks1VCB04Xg\r\njsxAb468jQaHWtauEzxA4jhPmsiMVhSc6HZP9Na9WqgKwW4OazQiyka/Elwn\r\n4NYdoXQ4g5cEbvvNsoWuvY0uTeM8bYMVO8Q=\r\n=wBJ3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.130_1681482977208_0.017694872829916664"},"_hasShrinkwrap":false},"0.9.1-next.103":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.103","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"61d5c12378a1c8214bb321a2c87050e61739f242","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.103","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-sRnWbda8s0SbhnVhOAaJDUFfnrGKi8pSxOH2tq/6Z4aXmj+nxmvUmVjXXYPj5/77qcxWJuoLGGuhk3VXn4S5+w==","shasum":"ad23c8f9399db758af89b4a5747fdd82c52b3056","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.103.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjLKrKhzr72lWbEJ9Ue4iC8nvrxshwtIUCPPiU7V+T0gIgFaRdVIDvFjfBLRZs9wimFEEGyf7dq5aLI8R7Sz3CHO8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPQ1KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHgQ/7B7QgG8y7IvK9OahknhIvffh4v++EGfGTyBVfXwZtv4hXKVWm\r\nYsY22OHXkFSZ4OYO3J8PVSuf3b6Tl2dk5635bKmkOi3npK8/4mCkAAPtorKb\r\nKeQHoYMpc0HWYjp1CoD6j5T7Dzw0FIaBZ44Xze/Sy/rOitS/8cSYhma6PPkI\r\nZg5b1kKBxnNxLRw845YTMyb9HCxWxPLtjuqvgbVlDt3Nr8bxUR705JoQtsWe\r\nRRX+G7LDDqsycdCCviLg2/ZyjbgrtSSSZRLR/1g0qL+xLgAxM2t/hVm4d6Er\r\nbJqsZHG+om5jK/yksAFXx6NepletDrAf4FSB0ol75Azx8ZajkyXLu1xKcxpP\r\niqqGHOq/SFzgOuxMucowHMfaso4UQBwG0ARqRA6Ecz00QCHtEPTEOdO2UmrH\r\nMlUEG+ijKN6kM32uixyMKkL7oswFPjbwZhYY86GYsrzTeaT1d4uMwsTLnGQT\r\nUGLHUcNgQ5dg99YZhT2ryU+OOumWvXCAfIQkJBVOiA/DK6kcFsEGJ0lz2J56\r\nfd2Z64FiZVBQ7LSkHPRNP7f+RUaSMmH4qGrYTm95OysaLLFaeWPj1T95Kdai\r\nqhRIZVOYZ0RLav0mQWnckce+GtHsqSe0OhBFb6K87whGdbFCE9Vx36XdH5zQ\r\n1QNKydbXa8BeRD7RFivVbtPyFmlkMiDJDSY=\r\n=OOf4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.103_1681722698065_0.5444160985131066"},"_hasShrinkwrap":false},"0.9.1-unstable.136":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.136","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"e9f30f1acf0fba4df29924d5a3ab9c1bf7e83340","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.136","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-MCJJt/qw10UARxI5kjshXrXUENwQHwJR9hXJ8lPadugTVu2XzNuN2OlRBCnNguX+0ZR5zWdsG6rcVWzoDCgn3w==","shasum":"473c0ff16c71a0e1ecbf9f06e492caa8e0895a3a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.136.tgz","fileCount":33,"unpackedSize":59567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjfsRqnIVouC6xczfx10G9KdVBq3GjSrOk1JqI9aU8KAiAfqewEPyNJUZIGQN6+fwxbp2PV/WPn7S6OdbUBxLbYVA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPVdOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoabQ//VTUy/xTIMIqr4nrbUb+jy84IoTD6jYmvjsBK7JrdfSPxVv8Q\r\nHSi5hCA7EzKf3RDsI/E5jrDFHotvkMzmCPY3rumHil7TMq+dMpmqtub0x83S\r\ngSeZiwzMYcUz4Y6uee/TTRVa2FivIQxfsDj8kMZPwGyUe7Hs1fss1bqcLXF4\r\nnKzCk2gS+BJXEhMW2UIpc/ZhixsXAUCOR9vt0UXQfPa3aDm838VVnuPWBSO0\r\npDPhYQlYo0GnI18CtL+xGYNLIeaGBLGEXuN5g359xXDirkmOoRCRnPRnODkF\r\nqCMWUOBA6B3jjemg3FkB/hF9/Qm4TdjlS/ecSUf5biazDwjZwBhUSuQYBNPv\r\nSTtOFvVXjxLZal6Thzl1NUT0zjt6QG8LBhj24EyZIehvWakYXhhWZH7nPNgv\r\nY9KmuSKOJZHTPBi+bwCBBoRb64NhESIpfs4SqWSFSmxGzwB+DrpQF6wFk7OB\r\nbdCGfrlp3vUlm/Hu6u1XJxZB2JATRoS8NUcR76WcyT6puOKFW/wvzaSPIph5\r\npbtQ6EjeIvGkfUz7vWhJiwzIcFjwiDoV7hPh1gPigzAl1yXOnNq0jcgquhJt\r\nMIpqwWUv27AazmL2wAwxFrE5FpD7/CD/ST4Z/zsKn8ZMRTt9Q+GXTfLdJxZz\r\nDIgN3z4YOR4307Fgk8udGn1Q+/mDf3JJJzU=\r\n=Psty\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.136_1681741646101_0.416874210154651"},"_hasShrinkwrap":false},"0.9.1-unstable.104":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-unstable.104","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"728c8e10be5ca3f5491c3f31870bbf57975c597b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-unstable.104","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-Qh5eQUaSQv1jxF+k0tQT/hsHbwGZsPmyutYEP+f0+XZg3xfrHesbGm5J0hPROWeUCmz6WCTDjI9kYsoQ10u62Q==","shasum":"046b91960aaf23d04a0c9a0a5fa7f48dee629aa3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-unstable.104.tgz","fileCount":33,"unpackedSize":59547,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH2oCtcYfsMRcE3/xSmZlRZi+0DkmTYVslT/3MNj9v1QAiEA9dCLR/PWQHZyOmKs/Fgdmrlq3eh+LCbOwHcxckqet2o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkRpzrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUuw//WnwxRC9XAzEnDDXt91POrxTVp2T5RPon7K6c7ljXa6+PDfBV\r\n18A+fsCCEQmFOT6ZHukp0ofDNA1ajVOaXC006HJxbv/1X6MajzAcogvhAitt\r\ntDZ9WqwRUjtF2roceStIxA+P4XFHN4j59KqhW0OQWsHVAYR+pvSyENbInH9J\r\nbvH1KtBWLKYg9ssib6CtPuvMLoTJkmHNP3DzlFOGVT2KlTa0GKPiuCXojvGh\r\n4M7wIE09RFVQtfLZHXEV4PYyxBHxQF8vSwCH5VrUdyjP368Bdj0xIKKpbL1O\r\nuDs0Pg3v2hR7eCnD/Y1dyWYNQlsDcCuQoXcWYvU+I1vWMUXQQXHr+n6871yj\r\nq651UXEUqZ3sYcm81YnPQduqBxER+ZSDiRa8uXEUZmV52nAmCcXSowA0VkjF\r\naQWyh5nysPBa+8lW/3U8tINgPKb3qnUeGI8XHewZezvwDWnkAYNfD7iCZrO+\r\nfUI2eOhCBU8sWSlwWr0FGL8NcTEsgCBxgyJPvwW9UH9DSLr24XS34Nwgzg12\r\nNF1D1dZcG1ig/o7F1JPr28+TpNhhpvhimIW6TO9sN8jxSoSQUh7RH1iFNm9F\r\n570VSclIOAhEDiEom9kGlPfqxFM5PxcvcYEDGk/nXHcqB0tPpFpx2MOqk8u4\r\nG6zCmuaTLGh8KAKCU8N0PHI/XxZXTlmI0qE=\r\n=kR2b\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-unstable.104_1682349291485_0.36774980899083864"},"_hasShrinkwrap":false},"0.9.1-next.105":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.105","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"cbcf678b279648f358aa9f9e56745b5745161e1f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.105","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-MxUgZNYGHclYda9q64bnu4XBBuit15KfeE0jNH0obmn9Fn0oz8E0xt3b9TVwRCx40mlpyPnsarYEjPkdWgpbGQ==","shasum":"fabbc42205b892b72316422a3b504a832953719a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.105.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdir33ABUppxd84d7GJJxira/JK+c7M4o2uge17ivn5AIgP5HaMfAS4qWuXoYtlanQegMoezajP9gNgSATcbaDQ80="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkRumPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1NQ//WTob1dUUGKelGSVtJunr5X2Z5d2VDAQVpGTZGuReL6aezmDE\r\nMPgEM12AR4YDR9dUwv2sdYX79XWb8/0OESKDriHDoKpvOOpLrZyq0YzMirOr\r\nE0HYsTG26IaTmsWucbFlRzkFtBv+RhctG1knHtT0U/3cmSXnyZtK99HgrLJF\r\n715wifjMHi80IMD4Ky7jWDwddGubEJtJWRlEl3IfZsi30RrdgPn5UEHWv+0J\r\nBJ2/1FiAtvYxtj1DhykJ/eZPhIeWKKjl+HpAZ/dKQUoZFEs1LDI1rB2+BWqC\r\nHBywSYHFNu6qzgx8lkSuFCUAiOzXB1pkj81OT/Bkwr9fInX3gjgk5ie6FMfH\r\nKHQQs53DTMPvV8/qaIAdkHYIhXGYzafxkh9mV+e+xREu9v8RDaBz3xH6W7W7\r\nPI8t3JeZhAAus53mj5m/U1at0OFWjxWcjnt3f3Jzee8qyAcQqMTfkoaEQnCM\r\nWlht4NPI/K1tdSE3YTgxKK14uKRp9cq/f5Wn9iLA5hQrHLtzwtkLJ7Q/Bp9Q\r\nKxrU5TrQO3Xd8tzalbzZ9KCtw2rAsv+Eftyy5EVGvTp57DnPE1tSecOG/SSV\r\ny37RM3hPC9K02J2Rku6oJpHM5WC/MZnJOS20TXDzFLcj8ehmVVKvvksnagwS\r\nnaqITeHsb6TeOKTlnvCHX54XtET5j9Wcbos=\r\n=ldeY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.105_1682368911480_0.7686258158842025"},"_hasShrinkwrap":false},"0.9.1-next.107":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.107","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"41161a405425e30dff40e39d6123368c58c3f655","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.107","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-I1B8c5bkbJTlio1bp3xgHrZAcOUEVzz1NlaPYonLoc9eFV0lVi0k4dhX/DdllEvoAmtqdsEEFZOuzhpLcKy+bQ==","shasum":"c6f514cc27abeb21e908e1855cabc8963ebb17a4","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.107.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLDBWLYCLcj5XgWpy8DS2qGyDAOmF4emepKQzGcZ5lCwIhAOt23z7btRUBIsEGNzO3namnPmI1ic/2gDzWA2LQ3nLk"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkR6RwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpB3Q//W/pa0YaYewsZiY6VTv6uw/+EzGPkAjG87CFAAZFz+m4P2iGS\r\nHIxgel1PhBWKb/Pgwyb3pP3PG81w0KcdmZUXeWQRF84g44jfENj4kMsSqX2/\r\n2LLBO4Qoh06JeBjaOTuUOst+WXP7QSj8f2mYWtCmAaDdnsZtDVQYi31ashbz\r\nHM97pSyTQdlPNjKsqtgevjQKMhJTSi3w58+fz+DrgjZjKY2mVJn4fbXJ+243\r\nxu1vvR9oCLilBeOfFj5gSJHUXvAIhgYA/cJhZ2KMC3xhJQfG6xJp4QFc+g/Y\r\nsMdYjCKCqdM6oQL+/HTYoS+XfSaJVXjiNfdgTIZfrL63rRkPdzEJFRS4oaA1\r\nZ3WxIDz+su9SSlg4AimxdS8Qaq60xFc1EjbVrMa4n1pwktIqh/GY0wShEurK\r\nEnDpWlD5JElXVxeuo2XUGnohlbNzxni0ccZn61dyRHxRnkv7ojR0lZ21MJ0E\r\nJP2sZOLnFsAdy8EIB2e1sesEVr1s9CdTG9fRNy6BeAAN2WwdELCpOj2G5pub\r\nEN15siu26Lc4lNo5hpmmXCYbdK75gx5g2Y3+/Z+REIveeA3H6zb4/BcxaMF4\r\nC8kCdqohuA6CbawhnFWXoBWaOASTkZ2A2lyP9fwZo+7P43UNp7mVdyaaTfRg\r\nwfx0/ZtXUdKc8UJtVLK2XCTsoHL51+BjXgA=\r\n=wv5A\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.107_1682416752644_0.11750006883616804"},"_hasShrinkwrap":false},"0.9.1-next.109":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.109","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"bd82063fc3f98bde5d171420266993642c530cfd","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.109","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-wY979BD+8gNYHMLHYg68jME9raqKo/IaOZwYBFyFlvvyjGqC3c82AfQGe4VdUorR34MH1L1UvkwmA8q6wi1E6g==","shasum":"137251c9b5a480e5dd070cd73716ff036ea86d7e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.109.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmkVUbxQaft/7yAInquJLhqcdlsgycDJUw7X3NCIh5igIgZw2HMjijV6BkgfoIWgWRQ7FrSCaqs9lubly/2NRG1F4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSQwIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/pg/+NtzcjeaLDdsxrkhaJJKBXFeyqZMlxBESx+6buK9RB4Vj+v3s\r\norb+n6IDM8dWAaff/1rVy0vFDvIeulzIBlcXmkjBMcAlr43Vqo+JFk/HMKG7\r\ndQaBOK7JD45MMeHUdFPw6zZEYt2hi0HYaEEYUG+sUPr9KfNmY4g/XXO8oBHW\r\nkEcPm8rLFbc/TxYj8gU8dWLPDEYRisrXXXCIFyQeqFFij9xBPU/849DQCjru\r\nVSZ1peFqB0E5kooSEStJZlA5gh0+/6nxSpt/S2Uqat9vawoqSJ6kq8ihiQFn\r\nhD++S+ML5vD+xLXbQmkDMvo/GLdGDKRVpRnaB0YR25Ks0TaPdCftwcxN1d6y\r\nx8Fs6bEY8zSmouq3z5cYF7ZlNwidDjat42XSPY1ALZVzPniBZLZH6TkSkHpe\r\npmpo2cfkWQKXxsRODbmZOMzCTEfp1gTWuLzRoDQQ16bd0dIaoZ3ei+0KGXyo\r\nG0YTC6Cc+KfE7Zp/RoeHmIGPdNZycwi1ogiRLur0ADlGajuTO/6zHRsIVXr8\r\nIAgfe3QWNbN7RHXdGz5y2E1DvRTcGmKjxC2BkOoII+Cf0nI6xGfIFI2D09/A\r\n7dwlpGEOz6EXcC3C9SWGtODyKOBCg4yEhKfEAuGfLhFWQTr0WUAFZBp6L3KX\r\nx+Iu9ifSm9rFJuYNxdet3i1J6XKi4XCkyZo=\r\n=N+yL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.109_1682508808235_0.9493361313563287"},"_hasShrinkwrap":false},"0.9.1-next.113":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.113","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"cc806d4e2d4da20a32fabcc806a560155e123487","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.113","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-jhb9BChqpssNcR69QA6rQdgeNQxs+OIYMogTMiIfgo3WpcDg2ENX4MzcvbddUhG49tRx8Qzl/OYbulOQse7Ghg==","shasum":"f172e74058e4122ea20a6516c1abf630d3ac3008","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.113.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQUDrDOdfx3xRIf97bGlMmMvI0V0AtE+uPs+nxccg52AiAE/FDdBFpTZ9l3nVDKpQEMwZUWAt5LQc+MXOiVzt6ivA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSTupACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6Zw/7BYfPOPjRmX35+b2l+Zi0oxpdJqsDIIHbByIZa/ajrpGnXSRy\r\n6d1WrDW6jebKpmAG0ddl7+3rp7E8jPk7uX1q1Yg283FAcWf4XNkK9FvtjdOt\r\nqOExPknBGpCakNK3haH2wuH25r3TV6Es7T/JzIzDezMlmAk89NdGukgo89JN\r\ncVb+j0cjbFkOGHK/IGPRRzOsGZc2XCMtE7NJgUZI/fRerYNfqX59qw9g25Hn\r\nx4W9aPRuI4m2wqJ/RQTQ5Sh/JPZnxBMdbjKcDzHa2cJr1d1BmonRhMLExkYt\r\ndBI/JginFhtvECGVaInlAo9WoKvbS75fir88CqMfoE7YVEFwTxQ7Ut5kg+2O\r\nTurrA/rENVrwZkBKhsUE+/TPveSwjvXD0FXbejy76K12CmZqVXL4pG8UvZ/f\r\n2FdHVNtpSHwgyzyRVDTR9yF6lxT+7qgqXODFBq67v3OLOn3GA5mOlY8QUQUG\r\n/MxggSIR2R3Yu5ZpHubwCfnFbQLt317itWsyBbq4TmzkWfb5qol4qe+iGOqu\r\n45adkqnoqNk8S3wgc3mi//HP9Na9I1UrfogBQ0v3ASZ8bwpMdZvGBFKtQ0Q3\r\nE3pxaUyk4kIhZ8SrAP3RQ0GuHw2K8QeRkGDlz5YDEeKqN5hRnkBJn7HvuX61\r\nciocnTnrCbNxQ/gnYLs+0oDqBnDC4LmsazU=\r\n=FqzZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.113_1682521001064_0.14182075874798628"},"_hasShrinkwrap":false},"0.9.1-next.114":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.114","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"08ec06ee2c9b883f7f497e960068458a51113b55","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.114","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-WFllFLViBNznL+5wSndNYKgUVXSFwScODIa+jZFtsv+gztIc1HNZsguMcKjSOrT3mGRyGhAKwVcPYH05gZkc7g==","shasum":"77c66d677c3438b82a19348aab5cf1e11dbd41f3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.114.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwuDjH23r3CUlIAGaV5yH8indrIJXDFwe3etL9K7VtAAiEAyKjqS6ZVxC+dfwh0Z7fxXxjKgyrSwA1J0h/9zIo1ARE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSsoKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrkNg//Qc37gTiFgEIVbnDY6S7r5FEFHLkoROnjtHGQlWJ55aEuB/MG\r\nOIRRiOZmL/KY9xesItdMlqZy3ewazN5xRbXq03JKpR253cU6VgO5fDKOtKqb\r\n5ehq+3kU/gbwz9UHjnO/1cAWswKAC7jK0P+nE1oRNF5+Du0+6Q51u+ZDUyUu\r\n6SMePauNWLVqm+AzWi/G+ipi6LzW/LnVdMR6Y3Wi2iEIEJgG4/oDtwRcv0ft\r\ncE785dW1meJHNl8XkEila6Suo4fYVTP1JFApPXOeILUVvL+KWGo82lnFDMSH\r\ngiYAgymLcIjkSkojT3FAZ5L54Hjvx3oEuUTxsl7V6eQnHP9Bcf9fKjXvxlHj\r\nTe6N6/vpm4fykfU5ydgWV7tnHxVHZHX3/aVsaHn7Po3amUPLesEkDrA5r91l\r\nt4eYvUznZ3Qf7xj9p4RnysuuxYfQxiLd0R/f64JXM85jwlMRwba3JVBxU2oE\r\nsmTVoa7/TUZdLrxW63ZNk3ycsyxoAePR7ldIDgrJ4ONM2eruWRC7BuBeWemp\r\n9JEmeJZx/p1fbh2syoetesy+0gvEfXX0ArmmquqJdqqPXFqIOqVlpU77U2a2\r\nqlxgo3RF5/P1by6pc2KVV96y5OBm8auRa3fv/EjuBkOaYSdam1KpwieYyxiG\r\nCU86BOSOSl1eabsQSPvvOVqYxAwm1WNMtgM=\r\n=W3ra\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.114_1682622985884_0.8417675856924633"},"_hasShrinkwrap":false},"0.9.1-next.116":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.116","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"01593a4452e25fed16ec878e17d70c280f28e4ca","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.116","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-12rzxkkdpjLWQHKq1pEFHxTqrOqDo3zf8ZF0LUCFO/vorWyr/Ca8+eLqzTEbqR4MndYXMUK5IlMFgIE3WveKbw==","shasum":"5b3bdd182b576414867de4423af5fcf1cbc83273","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.116.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICjzctfDWcOUVLF5t6YCXatPULDhEAOnch19GZq798uoAiA18W21hm47mLDL3mwBUT1kTMIi0p2WHvliG9bG6McgOQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSvLmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrg6g/+MTfFNE7uETbvUSvjW3CmiU/XWnftJ3/2SO8IE6qtTIKN1zfa\r\nHz4DJnph8UElYBT9iAZvuJJLYBoxcF8oUAVskfoYkuYmXhzKKOKUcspf8lH4\r\ne3xhIr11LtRCySY7VeUSF4riYOJkkkGouQM4W2t+4wfJ+cexGPR8tnz6KeG4\r\nQgLUZIkzvk7IL/FFMlKXte/L9hRggNn0JOaW33X3PoEabutBBrjrQYsWz3HK\r\n+4Q4TEldNSTdtn9F/hD4HMjrL6GVnNlehYhaPJKG59Zu6TwTIx0J22DTl/Xi\r\nwcB8ioNMNZlz1axaphTUBbeBHkyuSdsE9o4geqpYavFMD1d2r0yzIw0Y9mVK\r\niCRXbcnfaYznFslEf5QXJBag17HMIgH97G74iIUtOeeMrt0AfG29bvrY1KBg\r\nQGGwqHaCgYljkeZLhZi2GfvdWYMLblnxCFfwitTV8+V6OV5kNuBm7qBQDV/E\r\nMG1qWMCq7VsFtjhQAPi4i9VDhmfgq2rmocq5RHPnA/c6WQFG4iA7ydjYvTc9\r\nkr0vyCpBY7J+uAKrHPRO/w5UDkUWgCQbIvUQZLU2kQc1lC7yibkKfYhdE3+6\r\nOr4kghkG84/lOrhEGYsJ9rLHwIKAGtNVpff9ubZyxNRvqQTH/VwFWRJC8L7d\r\nEPBlRLxpHKljXsTr0f9ISsIUcVhKIDFzuyo=\r\n=1RDk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.116_1682633446688_0.948784519723374"},"_hasShrinkwrap":false},"0.9.1-next.118":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.118","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"612b082d754eb90402160f423d939f3a6f9ec181","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.118","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-8ecv1j+Z7xZWSbMOVsA5+4Gz0mhwxIG71JG5Tnv3oLIf3k8O+Hs+yKLmi1NWMg9oYcipYHMZkSeFSBltwCgMpQ==","shasum":"bae01e39695a1920bddacda3d2e91b0445dd0e06","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.118.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpW3pJnOUFojcC4cTbCuGOgda3buizAcjBwsDOqQ9OAAIhAKls8wpy++T3vmPEeTPzkYUKt3LwgQqq9pamkj+8B0JR"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTYHfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrsqw/+K2ZekZFrAqh4XsMBR3f5C5lxx+aJVSow0K/MORyUeftCww2h\r\n0hmhpCLAcXkAOtq60HiQDkTpJYuYip9O5IwPRwEAzRW4hqwrV9PWxw7TbQY5\r\nJeZ2OnAAyqUzkKh4XvxwfCqnK98e+T6FNHhzfJIt2yD6kqz1z0/7gPO86REv\r\npNhib6yb40KGvOqGNIaL0cB4lIhg9JmY2dlUZqlPDvQmcYriV+m6KcPg8J2P\r\n7aZlpavMx87C5mjmFTJdCWmK8uCK/tdTvj3lJxsLLuARykfcekZUZl4tlvbG\r\n9f9Mi0sKZHWHEXQ/MvoX7qlbEpV0H8QzKQNv1zQ2RhE3/UH35fgnCqCB2MVR\r\nbdJSHwwROHeSEEtwblhuha87Y8aJpTZa4ir9RId+QhO17LlMH3hGCb4HDz2k\r\np36rTQa8iB4Rov33JsGghvq4PHqEEe7gKM/UgEDNJ2u1YnHf6+DJOdc298tI\r\nKZS6MYlPIuOW3OD9Adk4tpA/jhmDnnJeNPeUy2rD1mk9Y+wOo4QA+kziU4iO\r\nAYJHYMLiQIDnhKOMfOsHf9nwkehkyqpNYaozEo33zIH8wIUMkgyu6QyMtUpB\r\nBqKlHYThP3iGzoK1EtKlSWm84hb6943ha7CZ0oK4x6oQUo6LyOcHrScD4sgo\r\ny0th20k+HBw/NDE5aIMlo31sqm28qwi1QKU=\r\n=63sJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.118_1682801119038_0.7250478935886824"},"_hasShrinkwrap":false},"0.9.1-next.120":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.120","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"198701dd4319c030608df1fc33ce25d62870dc43","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.120","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-B7PR/gVe2gqILNS5NdgrOY5u6w/hQEd+NLcSVLTyHYQlEhF5TFJsvoaXLf8bsIuydOvlUYUZSXH25kMwSO1rFQ==","shasum":"9205de75aae2149fb354b969b3152ca0bac71b7f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.120.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDE1NppjKTful+qbMLecKGviL10Sje05yKUW+t8AkSwiwIhANcb9amAwdyT4ryaU+XwCLllmeT4S6kXoA7WS1zicEix"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTkiIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3Qg/+Nqi7hHogxhkYJ5dOiW0r7vVxi+FilXGxZm8frc5JH9FGxXMW\r\n56XlomnvAAcMpmEhm/g6xqAFFbpn2Bh6y2EvDnakEmyNrEmh/AbcnXMezic1\r\n76WgDy6XH4c4Ethb7fdbnt5USByhaBLzmdo+Es/egrrV8wApKh6xiiwJax4U\r\nd3gsi3ebLnFlyDhK2XCdg7A8lmu/dL3yHVRV8mmzJBa1kODpXZ9ycBYWJTDg\r\np9aPMylpDwYV4trzZU48XeiAIaz7TRmRI43rnhudNc5hm5LTADZxlfHfiLws\r\nUoUH2ZPsghhyqIgaBJGttHtPRTOEVxZqiJOhd1ZmBelgq7znFzHMkGYKweUG\r\nHOBcD+IUW5wQcvFHbdndKgmpc48d6fnzBqR4Vqagj1MJlFy8VguKq+cA2Pvs\r\nwZb5biwC8fh5qEZL5xg6vuAOpAbimk0ixi3WINqWuhMQMd33DkvyOJlGgvRu\r\noE1kO1x0gIhMTrGIz754mC+dPuiWDxsb4L3CJN5/M1rSKgfj9p36l0pmSVYw\r\n+j9owNSNMu8Khonr8WHZkeZ++uSQH18ltwezkFg4Mf+rs/Ij9rKb4lbnyFJj\r\nsWILtF7tIM21tk3UYk7vivB6yLFvewy+X7/RtE+jiQQ8iZ/JPE3pnZrZwbJd\r\nFvOZOiL5WBWkAcyAADtrNe26dKd/0dzjwJQ=\r\n=LNUO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.120_1682851976056_0.30050758192499183"},"_hasShrinkwrap":false},"0.9.1-next.121":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.9.1-next.121","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"60cb6d63087feae065bd4cb5d43fb6665725d694","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.9.1-next.121","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-5UfwcmTiu/YrsT/5tJrcH9oVYPfM2J6Op5W3dqupWTzVX/Atq8iiRhysCeQnV3sx7SnHc32oqpRf5PVXrZ1JDA==","shasum":"924d765ebac3583f47f190b0d2a5f305e644a62b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.9.1-next.121.tgz","fileCount":33,"unpackedSize":59543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBgT7piOp+EhWHDF7SYPGSlChx2Pg/WN1TyBzC2fj+XgIhAI+V8ti1buow4gkX6AuK4+N0NTUi6hKq+54iRqwt6RXd"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTtIEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQpw//bLjYA/loGiVR2Q9ZAvO21ZkG7h+ZE23icrRvOKG2K24kpNhd\r\nWZqaI3u9Lx+ZmfTIcLyCZ0qcYc6Qad5PJflxwhMq3EOMcaUubGI3mKY2K9At\r\nS5in98Gn4CxzT4TObpOyH7cVdP/W/ZQf4t1Tr5A8T9HQgmjuI+WU+8lCxXMS\r\ngICLcmATb5+mYMHo05BJK1f3wn6mz1SnLDX7hJfui0mzmqu/+Uara5UGZk2j\r\nP2dpOU4/U8jaVLB0sLg3ZW5wwJ3FJzzh8YCZxyWYxtdR1b3UIVkhTHjIj2Z9\r\nyGkkE/EB1K8ttvja+NhBXPaJdAkHohPpfgIBem2XIABFymrD3yWqqqhTZBGO\r\nbe/j7iAYIqTDTxExvylGPsNAxQR6GNHrex16KBk5S98tmic9hc1pdCPXWNk3\r\ngu8TEbWCpKnG0z1GgDN2My67Mgwic2K4Dit3LsjOxiqCf40I6oUvcBhmrYRj\r\nYWtYKJ83+GNFtA8H2MNRLbPWpdHtzoBgsWDsagV9h3N+9hKEl6Fi1Yb3tuvp\r\nWtL0NiN+ggq2NkF00W6CWyr00RFZUgxzoX7vcA8H96502SFRCzbHXjaI/GyJ\r\nr2ERYBpTL21f56+OIn9AkQqr5XLO0yi5HES41WrrWA1Ej6NWiNoLgXL7ptpU\r\ncKsCxy0HeCe64GyvS3cy1mBEm1+0aqwJZ6A=\r\n=Od5f\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.9.1-next.121_1682887172168_0.8065310442326019"},"_hasShrinkwrap":false},"0.10.0":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.0","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"134e3ba941e7f9574c2e11c6d5088ab5e8581955","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.0","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-EjpK7HsKzvJug7M4aGBEN5JtBbViKqYPzv6045ktb3mwYInqDGG4lXg8gNbEECATRxJqkY8lSXQwN0n9pLGeJg==","shasum":"b5531ecc5a4b91b14181e253d1bdd6c655613bda","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.0.tgz","fileCount":33,"unpackedSize":59527,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1EIRYwlVxGY9GAZRkzVYqV/c8IntNxOiEAlfRvEcNgQIhAK1hMMD5M0gRFNpyvr0/5FoPF5ysXuqjEtowKTma/JTj"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTudkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvBw/9E8+SApF1acae3jb6GOtrHTM2vHD3YMWJUwVRXTYBZ749+L9R\r\nbBTegJ5C2SN0HSTHkW8WbNAwU+nIkbj4+tYhknxILBadM0kHneAXZOv7gsKm\r\nViAaHsZ2SkFZKu7KBIgLX1R4LnTPxzrf2TwN2OnPgGUZa/kU5+2cGQlR+dDt\r\n3Scvras5pRSyjclmOwinraoUoZE+6EkzpEuputuUlqpalNgeX+6omjb4rG0N\r\nsE3B8JqufTQNzGMSVrqXapIY78ZNKFpXoAEcvbUHQBwbRwKS1zu9VEw3aeLN\r\nQBEiZ61V3kggLP2mwgDldBSpD65VdUxHFuEFRHV92dwkZj6jnsUQYJjIHZS9\r\ndEEBWHnV89ofk61w5QdBaPK3SgtUi6WsdCjG/SAxwl0Pg9+5BzoTBTevWpOr\r\ndaIRTNtN9xyXMzAYfAn6nzSJ0fp8geZSvMpDF7W5z+o3aXpz3jhUFP38Hs9Q\r\nOhGUda6FQOXKaR3anLgV7JJxmOnek8xEbQ3TzRtafzmSvqeaspmPqxaeobd2\r\nNKan1PEXqdEAAA4E0SWYBq66EzfQsE10dGQ0MWdcfrEKp6faxi+V09Wg6ufs\r\nqspzUVIk+y+u17vGDgBsrQs0vPrPZV3h2si+afUvpB5eyn2N84Zdzm/mi6p/\r\nSeUQ0x3F59M5tRRDWaD0JIq2LDqnjwwcg7Q=\r\n=WO/P\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.0_1682892643885_0.7225623183720695"},"_hasShrinkwrap":false},"0.10.1-next.2":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-next.2","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"488111f22ed6a844f0db4738994647e02e0cf23d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-next.2","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-m1haNCZhMy0KgWoP5L0od1Z1Sy/vMreGqjxMjKCbI5yxcmcXaAgT8kppkUP4DlgYFl/AKMwc2/UejLdGO/ObRQ==","shasum":"c1eacd2210148654ea780a0e871569751e15122a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-next.2.tgz","fileCount":33,"unpackedSize":59542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF40dmye6vc8hkn+cGfgss4BnyCZzjxuioKMOQ5i+8WhAiBHZ98512g9T+Xo8TshocqIL7Km9VPAZlpSBuLXGBQFBA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTxYzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjIA//U/zmHBvrd29G49KbLdQR2c2H+BZaNH5RXUTnYWNcNRNPLl34\r\nny2haONy4kzrJAAOaKGOS1xX6xSrWjy/V6eW7YkqmIiVDuxN3K0oTZYDbJEF\r\ncBsLKoEHjA4g9WBffdGYWnJ8coM7946xnfgOV0J7Iy0I3cLUuuInC4zWfOQe\r\nZzaXFDYu5mWdbR+WiHHIqFYHI/MgElqKdeQpwxyUbMaKNMkfp1BB4kIKt5xl\r\nx3TRKTvcm0mEmZRw8Z4AddIVoyOcaHPvw10KOeayDMzP3600x0ghdPVABW5q\r\ngRyDaXI4iIeSZc8y1O+TdhaCe2iUXfK7wrjebg1V2R9BDDrFp/Ci2guhKsn0\r\nTbXHwzsr7BAcBOws2wtVlHm6ffGQnvFFJQTBltE6JqUv798vApVFJxOayp5V\r\nVzea8NuLGEQzx8N+f58adbf83x3wvD7vvSchFnNocxIX0P6PW1Mbgt1nquua\r\nyDA63XDZqEHttqoc1cSCZDPnyXuuRhar1iVn+l0dyeB4KFARYZrCh0SmHcaR\r\n86uCzRLCk+6PldhYqyGpJkDgL25GhxKgIRp+GtK1WuexRHbw+VAVfm7Mb2uN\r\nu1ZvyCgFWFdELPSjVcqBO1RagsCGoNTZjiJGWy/3zQmSjqdoOdnlHvXv9Vtj\r\nCT0bLpS+DG2Fgl6EIAOoG2Y8wvS3ZD4xqNA=\r\n=HGOG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-next.2_1682904627313_0.7548263378347793"},"_hasShrinkwrap":false},"0.10.1-unstable.49":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-unstable.49","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IQRCodeGenerator":"./src/types/IQRCodeGenerator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"79bca14b2561576176b0ed87bffb87f7f16a2c97","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-unstable.49","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-wuSqXUIPxKZCBrvwjuSZUERVblX5CbES2Fghgp2nkYCSoOOXkpyqw4OMlUmL74Y9pbiHzb81C007biS74R5EHg==","shasum":"554fd8e780be6b0a7fca9b8eb0689beebc2e8c27","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-unstable.49.tgz","fileCount":33,"unpackedSize":59545,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjFpJQusxvKOnp9TWzx6ByMO1qgp72MUlfinoa+LEpQAiAyWTs2DuZfJWMOfDx52dqlP//HiiDQy1lLiIVBRsvVRA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUmsjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFGhAAjq5rHcp0lU/2gMPoMrP0K50QHky2Amb7Ni0tu+BRLLfa/RLt\r\nHH9UxnBjzEanlwClkP2yls+eofZIkZad/mLlPh0AoC7OqxtEigibYsE7BNFJ\r\nqYh+krmEITL7UMtKgdIWANDnnIeEsBmfbHfLJxDLyavJ2z1e4lC4qQivFJFl\r\nSs3xOGTdDZtKjeCgRtlMm1CcTgzp4eExFmWvgCeSmXVqcmlws0F5iaRz649/\r\nAuadHsinRkHs8RW/o3XAx3OMe7QF53AKSSCOxPJa4pFUhidH6bn6Fpz8Yeu1\r\nGrObMQWzCjjHnqYEM4px62PzOpgH2H5PhBmuBZfEPDk1FDpQb3uPTVg5/YTd\r\nbKhZevtF6YlJF/t+s4HLcE4QKkn1eaIIa0x4tncEh+fD+ZaqT50moFFLbrFB\r\nVXyS5OynAlor9cWcEIEU3QMNFncR6eRai6JgmN5UfoUfMydQZ6ODzIezfSdI\r\ndXk7aHg0migMEehOCyhOUIGttUEEEmIOQf5BSDhpCe0qqm6iXMeoyCJky7zO\r\nwUVxPsioUbzm64e4FpwaDRjnmPkPBxtc4tdb/DyrKcUr9ZvmNEzy5/VJ2KRi\r\nnt5eO9Thy/3FEB6GEJRleAAaX8ykQN8YNdDo1waOsYz0kRdFiPAbvR0mvL+C\r\nuJHjwTcb/JKtdpmjBlYYWwXgV9EEOAv8LKY=\r\n=kMpa\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-unstable.49_1683122979523_0.25653870729692585"},"_hasShrinkwrap":false},"0.10.1-unstable.50":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-unstable.50","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IQRCodeGenerator":"./src/types/IQRCodeGenerator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"6f3a76c592a31dbf0c4d352bb55933372932ae33","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-unstable.50","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-oXPR+KQgOBe4CI0iEpKttm7kpNSTVjN9puzVR3cSDJIgrrHzMtzq4n/smWlmYNgJqydpSve4fgLF/P9/dOGptA==","shasum":"379611accd753382c08e89afaf7ee0c5d5905ee9","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-unstable.50.tgz","fileCount":33,"unpackedSize":59545,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHQf2oRFTDUHxglwCGrl2vLQPuiTdSeH2ixvFCgC81rBAiEAiw8Hm4dE0EPCrRWxVlp8cMet2Yyerg+pD4yEOPVkaXM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUnKfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBNw/9GaQjxd4y0p6GCwPIlnII0277Gh53MzqZpVLZe+8PgZ311FeB\r\n8flk+OaKg7LDXoQkFn3mW+PrLkmpVcYN2R9dywV2lhF5QKDDfRXgKZz9b7YS\r\nwmSlALXhv29COV5KtbbI0el22ghL15S5pkMq4YhZ7dTQCqxks7BFoohG6Pyf\r\nd3wlVG5Ru7UZ5q/6mFtKAl7uoAGWzMXuJmyuiFlNGJdnKeKaGXlYjtEBoT8W\r\nJS1KbFPF3OuCGb8sUURn1wtnYL9MBFDJ4rxzRUIgxxYss0wjWZ6xHlP8Psa4\r\n/Wa+tHRKkiVgFphesSZ9YoJHtnieOZDYZ3WxrL4wQxkee5GIZwX8SisHyK+w\r\nGc0DdSrITiucBa8zrtCUvBAJrQiZrcxTff+uOLe349Vg975ylTQNtO6Yo6Jy\r\na9+QLZ7e5zbHgu/84At7TGxeYxhOp0uCGw35a+Qpvszuk8SSelaBrj4I4pKK\r\nk3x5+VgELPfRSWkugCJVlxMul9zajSbZWFOwGw3dzZJ8Yf8Eg5CYHUok5wqD\r\nNie9uBivmoVhEaWOIQVHSZ9mrOq4fnVTbXfq9ddT2/8nxwGo8Fp3+VOFMT+2\r\n9BMLPV1djQ38HhaKA1p7+y0sQ/wD87djEaTMbFQVcFFkx65Hcz2XxBlw2mKQ\r\n+tZzPxSPHdGXKf/+FGkrvgqnIiO+fGrmV50=\r\n=L4me\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-unstable.50_1683124895264_0.6069506118347712"},"_hasShrinkwrap":false},"0.10.1-unstable.52":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-unstable.52","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IQRCodeGenerator":"./src/types/IQRCodeGenerator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"84637764cbeb97af4d4f300ccfef01fb77c280d5","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-unstable.52","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.6.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-CW8M+H7Im+cb5Z9guadT6WvpEmiQEl/1uAK2ptaFG5YYOoNQiYp+V9/IxkfZ/eM8Dvh5y+K8otWFziYXVE15pg==","shasum":"a0c1dc33ce70223f91cf0a7e8a3ae63e5c6d46ed","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-unstable.52.tgz","fileCount":33,"unpackedSize":59545,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBCnRf2EvJTExaP5pVG0STCbsE4KEfK3F0kHhtpchnH9AiA4o10UV5iKnM/O3mOOylp1TAEhs4Irb2ZhxL5GWxY0XQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUo6AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqnaw//UQCimzI63uPks7vol402+OCJyoo+8Z1DVSgWFy203YzXzd4h\r\njqeZ+tYqWQEP6nhY406NOLThi7h9945NGFMEaWWzYgd1Oduox8QfSs3KCme+\r\nAOZwO+S3z7jKyRbLihe7l8lYugu6frvXpmY8KYcHe5s2Oxnx6ncAP45Z0Li5\r\nULZ4poJ9vKSerNrDBWQZZ60t0zsUv9eX8CNIDqtb5F6tfWOqtNzE1fQ2BGjl\r\nP65XooWtNcizDJxalIKMbtdB/I0ViZyyaRMpj/Wy9pu4e5Yei7jLlNkoJ+Af\r\nLIxGujL7AY18WksGB1zWF/m+xOGV2T+HzvU5uPrPcZQyYhZV/FAlWcm0mfdk\r\n5LAzSycFyPQ6nFY9r+vWF+NRkaglTzrTr7OwzxEQD7tj4w+YpS/8tAXXI5CB\r\nJQUghPwX1aHqDsBPNfH+2OAWKlTK/fT2Iik7Fq6O6Mq7Ljr7RWvvvqVdubwN\r\npN5e+stfJrZaBjpjXbIyCOSdMCcQOJq32x+ifhpoBR2JtX59G0xd68wmQBuc\r\nfSrrUnNQ57RuEIG2F3cN97CrBaS79IKW/FIUPEgA7pzEsHpPbEgjqSkiB5su\r\n3cqkdWSJmkNAS70A1qdt1t7XW+CafyC/tmvwssOcotvog0lRRI/8Y8W9oJmI\r\nkf4XwAc1QCpOEOSNV8ea4Mfai1+J8lpv0C0=\r\n=6FLZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-unstable.52_1683132032219_0.11751000651106969"},"_hasShrinkwrap":false},"0.10.1-next.6":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-next.6","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"ce5b487d4b5831aa033615fec9e4a45c19c1f3f7","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-next.6","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-/q6if87P+kLfebcLda7+AoBkgDQ+YwOG1It+U3Nt3aBJrspsVM79e4jqso34qXfYK7tSjkOmvNiU4RhnjKpsiQ==","shasum":"ecb8a1ec122df60ff0d3b1a20e57cbcfff5f29d4","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-next.6.tgz","fileCount":33,"unpackedSize":59542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwBjPY72QKVn0f8EN9u2VmP0hr5kUY55OcyTGaoaO9hwIhAP8HJmVHt+B/LbHd7hnyuAcCZcRP1Xa/nZksZJljZNUO"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkVD1JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHJhAAkPTbQrU4X+ZFovlmf4uRIvU8Dm+hliUQSzSkKc38s9fGjyUk\r\npUEPodNaEAORH1IowdgzxD8szjnHAp6Psf6QuCA8lbTjxpXwqRT2is26tG9p\r\nAENY21+1m234SdzrVExw39SZUH5ZJyQi3qxl6Tw2Ru3esfZ9RCWsIFR6CEiX\r\nCGXSG1namDCrahTBhcMxXFH7tNl+jWPUrivs0fkwGYc9Mdoxv3wELqGKbmAx\r\nrE7t7SzxXwGBogh19XnAqUb17zRT5uZOfPKwqJxd31VpNGWEsgAF1UxhUbO2\r\n9LBT3sXsucrBqNie8ba26pfhsfdgvsOWAeP+wwDz7qd6HrSj8Sp9P9hKvuEX\r\nicQ59G/cIuzYSySd62Fc1+zoFJHUjPEor6nJIxudtm62jMfnQMmOJW8o7PV+\r\nN9CICppk69Xr+epF5g7qwe6JjM04zJAGEs9JPYTkXpBUz9tiNY1uIucxoPlC\r\n3WeMpZIcTeNYluSBo8GJp1edYpkHZjfNPJGUqIt2v/51ZrVoQH+SNcaYw17O\r\nicJO1NwGDmkCpaD+jnmdtL7hz6MescI9IMvE+8CzQ9Pv4gHlEO/HFYm5XjVg\r\nOAN2+Z/oJkYKdNqvsUMrvcO288yNbFWI7A73DXjnnbVI5S/MTvVaN9sfHC3R\r\nIuMR7mXhrbQSjDdqhiBMwWtkRvXK/VDPML4=\r\n=wz9n\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-next.6_1683242313068_0.9217325588252203"},"_hasShrinkwrap":false},"0.10.1-next.8":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-next.8","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"7df0e64ad6553e8153cf96d62156867fde8e4cef","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-next.8","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-mLYp3RxOJSNdt+LKwMiqZgDcyqmngHwXjH9jyKL2Ii8lBU2CmEUPrdm98FS3PFPouF3pOZza5OwU51tAGmFHnA==","shasum":"c53ffd73a1a441b4ef796603ccf5834726126c7b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-next.8.tgz","fileCount":33,"unpackedSize":59542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCY1Z246tE1NF7nPEOEK3mfkLiIOZsCqe7KMzgb9lSAsQIhAJPlOqR+IAqnodVciKAXPl1r5ulL5iZondUS+BSNeNli"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-next.8_1683307201363_0.4544618823068707"},"_hasShrinkwrap":false},"0.10.1-next.9":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-next.9","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","@veramo/cli":"4.2.0","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"1b2d26bee8ef80eedbdb3389a36c960f30d9fa9d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-next.9","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-p0oANxK+eIawyjz4E8gClsc7RGM1ZD1J6VhFqLe+4Tq7XYAnQxpKBuJEJcBpjzWV9U33lTInzE0Ok0icDzgfWw==","shasum":"6fab1051143b525ba744d3391786bac91abcd183","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-next.9.tgz","fileCount":33,"unpackedSize":59542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCt5ui2gK2Qy6jTM3u266G+Ynim03crg6SUb7a2bleFMwIhANijKw3mNJyro6eQsEcY7VnCu2eMrmcIyvPLdiGDIEN8"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-next.9_1683309622013_0.8409892099841487"},"_hasShrinkwrap":false},"0.10.1-next.13":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-next.13","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@sphereon/ssi-sdk-agent-config":"^0.10.1-next.13+8f56f22","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"8f56f226b2845ec49488734fabb9fde6ae707017","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-next.13","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.2/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-TJnKnLQta6TJX1Tu/DmFOlEyqwbNtspfx8nGCOABsm/oEpGsxcy1yt/lJWTXW2rhAiO3SGshjsXSP4Han9/yPQ==","shasum":"a3926ba50d0496fb958ed570d599227bdd33387c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-next.13.tgz","fileCount":33,"unpackedSize":59580,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICJSGQ/Gf7UtjoJ824Bs4PeoQx9wSzBe9u51J5keTKqiAiEAqVhuXMApc6sIJB9GoE/px4yioKYjLfM5DEHNOvoLXto="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-next.13_1683332798816_0.7208323911065864"},"_hasShrinkwrap":false},"0.10.1-next.14":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-next.14","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@sphereon/ssi-sdk-agent-config":"^0.10.1-next.14+344ae1c","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"344ae1c41b4c30ceab399df3ee531635ae789835","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-next.14","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.2/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-0BUF5BQ5kn7hVuWQf8MXn/uO3V1o9ueodni0D9pqLoCINsBqNr+t+qf3RuMsYsVduMbsmLi547oh8kIL0gqJrA==","shasum":"49c4d4c52cafeef6eac588ff7ae0d7f6da22f99b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-next.14.tgz","fileCount":33,"unpackedSize":59580,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCA2ZACW7WWdHhSzEeklAU8nHY5D7WSMk5xPNbwxP0iZQIhAN4IShHocjwz+rVDJN7soSliVEVekxHjNSphFuFVzEru"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-next.14_1683357311433_0.1830524435139056"},"_hasShrinkwrap":false},"0.10.1-unstable.73":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.1-unstable.73","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IQRCodeGenerator":"./src/types/IQRCodeGenerator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@sphereon/ssi-sdk-agent-config":"0.10.1-unstable.73+ad39a5c","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^27.5.2","@types/react":"^18.0.28","@types/uuid":"^8.3.4","global-jsdom":"^8.7.0","jest":"^27.5.1","jest-environment-jsdom":"^27.5.1","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^27.1.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"ad39a5c4eb0893c4699ee119214d638f954486d4","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.1-unstable.73","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.1/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-RbbUz1iTFDrBsJ1lFV4CRqkk+EUi/tYfSWTCcLE286U2LNv9h2mtkGvsWb1UHc3t+JQ7hG/7idpIni+kpDn6iA==","shasum":"79798779bc9d985bd7dff2022ecaa2b830895d6c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.1-unstable.73.tgz","fileCount":33,"unpackedSize":59585,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDb+RtPvK0UAEnVN+TO41hATDEsR/plLk6xwwi7gP59ZQIgEm3xkDc6Oj0Tu5XrnV+DDeww8MR+uQg4F5CCP8K9GfE="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.1-unstable.73_1683495194906_0.2849147279023483"},"_hasShrinkwrap":false},"0.10.2-next.11":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.2-next.11","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@sphereon/ssi-sdk-agent-config":"^0.10.2-next.11+6e6b83f","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"6e6b83fe7e6887cd2faad5846b8b1c7ad24aee7b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.2-next.11","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.2/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-uNguOQSRyJ2bwU55Q+qskm7MvZYdMGYxlQUKM/9ze57QUjYeYcfFy9Uc8jDwmsaU69a2lKYJ+Pm24ghRya6jmQ==","shasum":"e1795f7fe267a5204b54880698a6c53dff379c6a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.2-next.11.tgz","fileCount":33,"unpackedSize":59580,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2x32iJcWtXfwPDiPQgYSGC1UNyfcAagplbWT6bxvvXQIgTNDnpzGPk9NQWTzvSNcUzs3MlHzSnhQ31DqYf+Y7Pik="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.2-next.11_1683495865192_0.65047768927128"},"_hasShrinkwrap":false},"0.10.2-unstable.72":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.10.2-unstable.72","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IQRCodeGenerator":"./src/types/IQRCodeGenerator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@sphereon/ssi-sdk-agent-config":"0.10.2-unstable.72+34aa2c9","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^27.5.2","@types/react":"^18.0.28","@types/uuid":"^8.3.4","global-jsdom":"^8.7.0","jest":"^27.5.1","jest-environment-jsdom":"^27.5.1","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^27.1.5"},"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"34aa2c9e407ad98fdacf62c68fb85425a31c9856","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.10.2-unstable.72","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.1/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-QjktLDkOV0mk4dOpTBc8xcepsut8pzYkxiGnMlcKmjDDwcEE8/3FwoPlfZq8ycTOtitfUnRIqNJ8f2e4IqNxAA==","shasum":"b058ed53f97289e36fec296174a5126b6de92f0a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.10.2-unstable.72.tgz","fileCount":33,"unpackedSize":59585,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDK83Y7KDXpASUajADVSHxB2jwoQ6FmojIiuJ9giPkFsAiA/Rk02vuwN2bETh+UW7HkNlfIydPw+ClJiztretwKDYg=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.10.2-unstable.72_1683495893669_0.527056600206931"},"_hasShrinkwrap":false},"0.11.0":{"name":"@sphereon/ssi-sdk-qr-code-generator","version":"0.11.0","description":"QR Code provider (react)","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"ISsiQrCodeProvider":"./src/types/ISsiQrCodeProvider.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@veramo/core":"4.2.0","base64url":"^3.0.1","react":"^18.2.0","react-qr-code":"^2.0.11"},"devDependencies":{"@inrupt/jest-jsdom-polyfills":"^1.5.5","@sphereon/ssi-sdk-agent-config":"^0.11.0","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@types/jest":"^29.4.0","@types/react":"^18.0.28","@types/uuid":"^8.3.4","global-jsdom":"^8.7.0","jest":"^29.4.3","jest-environment-jsdom":"^29.4.3","jsdom":"^21.1.0","react-dom":"^18.2.0","ts-jest":"^29.0.5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"gitHead":"c0b30e037a02bb4bedbf1165feb73184ca8ef571","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-qr-code-generator@0.11.0","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.2/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-fgRWgYg0sUpkSpEUxDfwJzO8RP9hVwBcUgxC3MeN+XscI9T839AbqyVlgL7d6BGPnSG2NQ1SUI8UqDP0DcSNPw==","shasum":"d61c166d36b2e4acc5e7211aa7abfe57771d5dee","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-qr-code-generator/-/ssi-sdk-qr-code-generator-0.11.0.tgz","fileCount":33,"unpackedSize":59548,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/T6M2IjRnyODzj0Cla2WZtQHZmO0dHYWOZH4aYTY6NQIgQZTI96ZWTaVq3iirQgo79oXKUgZ+ANtL7zu3XqGaYQk="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-qr-code-generator_0.11.0_1683497034764_0.6001891738164822"},"_hasShrinkwrap":false}},"time":{"created":"2023-03-19T00:04:39.645Z","0.9.1-next.56":"2023-03-19T00:04:39.884Z","modified":"2023-05-07T22:03:55.053Z","0.9.1-next.62":"2023-03-22T00:37:10.351Z","0.9.1-unstable.66":"2023-03-22T12:05:38.946Z","0.9.1-unstable.67":"2023-03-23T09:12:04.877Z","0.9.1-unstable.65":"2023-03-23T11:57:25.154Z","0.9.1-unstable.68":"2023-03-23T15:13:29.222Z","0.9.1-next.69":"2023-03-24T11:59:09.059Z","0.9.1-unstable.85":"2023-03-27T10:49:38.829Z","0.9.1-unstable.87":"2023-03-27T12:09:26.413Z","0.9.1-unstable.88":"2023-03-27T12:12:01.102Z","0.9.1-next.89":"2023-03-27T21:34:13.540Z","0.9.1-next.96":"2023-03-29T09:06:57.902Z","0.9.1-next.97":"2023-03-29T19:23:24.954Z","0.9.1-next.99":"2023-03-29T19:26:11.680Z","0.9.1-next.100":"2023-03-29T19:35:26.954Z","0.9.1-unstable.108":"2023-04-12T23:22:54.706Z","0.9.1-unstable.109":"2023-04-12T23:42:32.313Z","0.9.1-unstable.101":"2023-04-13T09:46:22.364Z","0.9.1-unstable.112":"2023-04-13T15:22:32.616Z","0.9.1-unstable.113":"2023-04-13T15:40:12.501Z","0.9.1-unstable.114":"2023-04-13T20:42:34.510Z","0.9.1-unstable.116":"2023-04-13T23:06:13.786Z","0.9.1-unstable.117":"2023-04-14T00:30:45.703Z","0.9.1-unstable.102":"2023-04-14T13:15:37.501Z","0.9.1-unstable.130":"2023-04-14T14:36:17.400Z","0.9.1-next.103":"2023-04-17T09:11:38.277Z","0.9.1-unstable.136":"2023-04-17T14:27:26.318Z","0.9.1-unstable.104":"2023-04-24T15:14:51.657Z","0.9.1-next.105":"2023-04-24T20:41:51.632Z","0.9.1-next.107":"2023-04-25T09:59:12.850Z","0.9.1-next.109":"2023-04-26T11:33:28.415Z","0.9.1-next.113":"2023-04-26T14:56:41.215Z","0.9.1-next.114":"2023-04-27T19:16:26.076Z","0.9.1-next.116":"2023-04-27T22:10:46.942Z","0.9.1-next.118":"2023-04-29T20:45:19.254Z","0.9.1-next.120":"2023-04-30T10:52:56.211Z","0.9.1-next.121":"2023-04-30T20:39:32.351Z","0.10.0":"2023-04-30T22:10:44.080Z","0.10.1-next.2":"2023-05-01T01:30:27.505Z","0.10.1-unstable.49":"2023-05-03T14:09:39.778Z","0.10.1-unstable.50":"2023-05-03T14:41:35.430Z","0.10.1-unstable.52":"2023-05-03T16:40:32.416Z","0.10.1-next.6":"2023-05-04T23:18:33.243Z","0.10.1-next.8":"2023-05-05T17:20:01.594Z","0.10.1-next.9":"2023-05-05T18:00:22.235Z","0.10.1-next.13":"2023-05-06T00:26:38.983Z","0.10.1-next.14":"2023-05-06T07:15:11.675Z","0.10.1-unstable.73":"2023-05-07T21:33:15.076Z","0.10.2-next.11":"2023-05-07T21:44:25.347Z","0.10.2-unstable.72":"2023-05-07T21:44:53.846Z","0.11.0":"2023-05-07T22:03:54.932Z"},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"description":"QR Code provider (react)","homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","keywords":["Sphereon","SSI","React","WACI","OpenID","OpenID4VP","OpenID4VCI","QR Code"],"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"license":"Apache-2.0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>qr-code-generator (Typescript) \n  <br>\n</h1>\n\n# qr-code-generator\n\nA `Sphereon SSI-SDK` plugin to create an QR codes for `SIOPv2/OpenID4VP`, `DIDCommv2` and `OpenID4VCI`.\nNext to the above specific QR types, of course you can also generate generic QR codes with this package.\n\nIt is tailored towards React and React-Native but also provides textual representations.\n\n### Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-qr-code-generator\n```\n\n### Build\n\n```shell\nyarn build\n```\n\n### Usage\n\nThe usage scenario will include the plugin code to be integrated in the client code. A party will be requesting the\nrecipient to either:\n\n1. authenticate itself to the requester\n2. inviting the issuer to issue a credential\n\n#### Importing the plugin\n\n```typescript\nimport { QrCodeProvider } from '@sphereon/ssi-sdk-qr-code-generator'\n\n// Include in the interface\n// const agent = createAgent<...  QrCodeProvider>\n```\n\n#### Adding plugin to the agent\n\n```typescript\nplugins: [...new QrCodeProvider()]\n```\n\n#### Inside the component we can declare or get the values to pass to QR Code plugin\n\n```typescript\nimport { WaciOobProps } from '@sphereon/ssi-sdk-qr-code-generator'\n\nfunction getOobQrCodeProps(): QRRenderingProps {\n  return {\n    baseUrl: 'https://example.com/?oob=',\n    type: QRType.SIOPV2,\n    id: '599f3638-b563-4937-9487-dfe55099d900',\n    from: 'did:key:zrfdjkgfjgfdjk',\n    object: {\n      goalCode: GoalCode.STREAMLINED_VP,\n      accept: [AcceptMode.SIOPV2_WITH_OIDC4VP],\n    },\n    onGenerate: (oobQRProps: QRRenderingProps, payload: WaciOobProps) => {\n      console.log(payload)\n    },\n    bgColor: 'white',\n    fgColor: 'black',\n    level: 'L',\n    size: 128,\n    title: 'title2021120903',\n  }\n}\n\ndelegateCreateOobQRCode = () => {\n  let qrCode = createQrCode(this.getOobQrCodeProps())\n  return qrCode.then((qrCodeResolved) => {\n    return qrCodeResolved\n  })\n}\n```\n\nOn generate gives the following (example) output\n\n```json lines\n{\n  \"type\": \"openid\",\n  \"id\": \"599f3638-b563-4937-9487-dfe55099d900\",\n  \"from\": \"did:key:zrfdjkgfjgfdjk\",\n  \"object\": {\n    \"goal-code\": \"streamlined-vp\",\n    \"accept\": [\"siopv2+oidc4vp\"]\n  }\n}\n```\n\nIf you want to create the payload manually and want to do serialization yourself you can use:\n\n```typescript\nconst payload = DidCommOutOfBandMessage.createPayload(getOobQrCodeProps())\nconst encoded = DidCommOutOfBandMessage.urlEncode(payload)\nconst url = oobQRProps.baseUrl + encoded\nconsole.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19\n```\n\n#### For rendering add to the view\n\n```jsx\n<View>\n  //...\n  {this.delegateCreateOobQRCode()}\n</View>\n```\n\n### OpenID4VCI example:\n\nThis is the credential offer\n\n```typescript\nexport const credentialOffer = JSON.stringify({\n  credential_issuer: 'https://credential-issuer.example.com',\n  credentials: [\n    'UniversityDegree_JWT',\n    {\n      format: 'mso_mdoc',\n      doctype: 'org.iso.18013.5.1.mDL',\n    },\n  ],\n  grants: {\n    authorization_code: {\n      issuer_state: 'eyJhbGciOiJSU0Et...FYUaBy',\n    },\n    'urn:ietf:params:oauth:grant-type:pre-authorized_code': {\n      'pre-authorized_code': 'adhjhdjajkdkhjhdj',\n      user_pin_required: true,\n    },\n  },\n})\n```\n\nIt needs to be assigned to the credentialOffer field in the data scheme. The same can be\ndone using a reference, this will require to use the credentialOfferUri property and assign\nthe uri of the credential offer to it. Notice that the scheme defaults to `openid-credential-offer`\nand baseUri is optional.\n\n```typescript\nconst openid4vcObjectValue: OpenID4VCIDataWithScheme = {\n  scheme: 'https',\n  baseUri: 'test.com/credential-offer',\n  credentialOffer,\n}\n```\n\nNow the data scheme needs to be added to the QR code data\n\n```typescript\nconst openid4vciDataValue: QRData<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  object: openid4vcObjectValue,\n  type: QRType.OpenID4VCI,\n  id: '568',\n}\n```\n\nSo the QR code can be generated\n\n```typescript\nexport const openid4vciCreateValue: CreateValueArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    console.log(result, null, 2)\n  },\n}\n```\n\nAnd eventually added to an app\n\n```typescript\nexport const openid4vciCreateElement: CreateElementArgs<QRType.OpenID4VCI, OpenID4VCIDataWithScheme> = {\n  data: openid4vciDataValue,\n  renderingProps,\n  onGenerate: (result: ValueResult<QRType.OpenID4VCI, OpenID4VCIDataWithScheme>) => {\n    render(<div data-testid=\"test-div-openid4vci\">{result.data.object.credentialOffer}</div>)\n    console.log(result.value)\n  },\n}\n```\n","readmeFilename":"README.md"}