{"_id":"@tbd54566975/web5","_rev":"91-9f16e728e24e6d2b33869d2d4bf64c16","name":"@tbd54566975/web5","dist-tags":{"latest":"0.7.11","alpha":"0.8.0-alpha-20230728-c384773"},"versions":{"0.0.1-unstable.2b1701e-2023.3.07-20-43-27":{"name":"@tbd54566975/web5","version":"0.0.1-unstable.2b1701e-2023.3.07-20-43-27","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.0.1-unstable.2b1701e-2023.3.07-20-43-27","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"c4628fc5d2f63f5b5c541cc8ef914a044cca41e7","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.0.1-unstable.2b1701e-2023.3.07-20-43-27.tgz","fileCount":14,"integrity":"sha512-Pk2xnhAKyvWC9tf6UaDbcocKtxLbs7Qy2id7BZN8Tw0OOFQPERXuDs8UrmCe5dnG6/RLWTudDFfC0JECcR1NGw==","signatures":[{"sig":"MEUCIQCb/qt0lc1aZt2yyjMcVo3031iQw4TM2b32SoNWfG9qlwIgHkISAf3bQQeJqpiCWQb8jC8E6YeNqoMnMXLQxtgNA6U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14504474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB6H1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohTA//YC7ho3KOJW5HStTjceyesHfV2vSvFWRsNKcycX/MNR3rtf+9\r\nMoWHwLaLbf1tioAmh/UNYmd40qUvOL3CRMCLve1bYKHfiSbC75IcEc5E+f6n\r\nIIsn19DCcOkZvpM5oqmaC2x2F3KwvER1aHlrNkUxzTos1hmglhwSHW+aGXfm\r\n9PKEp49dv3jnGRsorJzDGMHFTPl9yUGLtJ2iI/fosCo2JCHc0CVOg5tFPyGZ\r\nHs8XEEIOJa8nSO7SwNha9l9yTmhFn7pqwRzH3597TVs5uQwU2BtsHU3pPJYH\r\nH19Vvy1SnkP8SGGDlZH7WVATWsVXmvJxDtJsMDzBKu0dpzkQxxluYxfQJjSF\r\nVIVPSXrto/oPLSVewTIoIb4b1ws3ByYcwzfF9r/QS9QQBhmrJf2NxMnwIuUz\r\nWP6rji0tJVnpcTw3kGBKSlXl3pM1GDni19MdwtPuwelef4Pu36uK5Q/gtjF6\r\nVmeDnihBGKf0Lh5SfcIwBlgRdrifkKgqWGAx3Gr44odxO34yjo/7hFTK2lDV\r\nSGo9gAvGdUADLh5PTnCY9yZdy1NBJgeZglAowNoBkLgj8Fi/mRvPcDOz45EC\r\nAZySI3KGiCECwPyc/6erfSV5U28xg87owku+a842xCpxdXARNvcBFxiPwUKN\r\n7Q6n7kJiTaMIEGbJvtviCIibrxTvFWJ32KM=\r\n=zuyQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/esm/index.js","type":"module","browser":{"./dist/cjs/src/index.js":"./dist/bundles/browser.js","./dist/esm/src/index.js":"./dist/bundles/browser.js"},"exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"gitHead":"2b1701ea527ba6b5d23b93a98c501e7f42baeaea","scripts":{"build":"npm run build:node && npm run bundle","bundle":"node ./build/create-browser-bundle.cjs","build:node":"node build.js && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"esbuild":"0.17.10","deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","node-stdlib-browser":"^1.2.0","ipfs-unixfs-importer":"14.0.1","@js-temporal/polyfill":"0.4.3","@tbd54566975/dwn-sdk-js":"0.0.23"},"_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.75.0","webpack-cli":"^5.0.1","source-map-loader":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.0.1-unstable.2b1701e-2023.3.07-20-43-27_1678221812826_0.5707270918528811","host":"s3://npm-registry-packages"}},"0.0.1-unstable.389755f-2023.3.07-22-58-58":{"name":"@tbd54566975/web5","version":"0.0.1-unstable.389755f-2023.3.07-22-58-58","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.0.1-unstable.389755f-2023.3.07-22-58-58","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"05f6c26aecadffcdc72e68b324f36595f8137777","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.0.1-unstable.389755f-2023.3.07-22-58-58.tgz","fileCount":14,"integrity":"sha512-LLC7Y6DIJIzF7c7VquJyihG+tiepboKtdoUSFSgynB5edUOikXwmiX09+khFC/LfCG+2pIrsIRbmkhJOV5x5cA==","signatures":[{"sig":"MEUCIQCeypU8Apl2EPycFPt230jpGbE3N3sPVn25BgesEoqUJQIgTd2bNZgowhO0RvK6n6TIPo9AVIn9T3zHz7b2HNMO+nY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14506655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB8G3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmozGQ/8C9MihG+bL7WkxGzUHkQImtjsyyB80SFafMR7fiFSXj/jL8KH\r\nQ/SVr5BuAOmLmDqsX2FSNMJyPRzOLD0QFLEcE7yicUwKHqfZfWKzUPhQXSmL\r\n4gN76yuIHwrK9JoBf3Z4soMbhdMUptj57wA9bz2T3uGq3ROWPc+qB60Uljbu\r\nU2NKAMrJT81vqAccx5qqLIWA6fI6jKei7FR0dgC/a3xNXgxq2jjnEPRUxB9T\r\nx02+AaEuqJJaxs7DM0Lew++aeynbtjmyVJNFFuZRd7Sfe6aUhIYgJ/yNPrSl\r\nQJFt7EUfQg9onT3ayHswAt3MtOokUsnLd0IdrrsmasJzB5UomO4Wski/roCP\r\nmdxuL4tnD1B1yN6i/Keyd60y4Fg0oqIY7EPGQx6AwHkD7vj7g4hWdSP6EWbM\r\nBH1JTNAFbqqE1tD3jzlgfNA+uSzeHfUHRMblgcdYXn9jrefiJgJxJRJDJbxM\r\nmS8+JnmD094IDTr94aywfQE29gaSzfiD7/IKSROddnX1aeroN012uedJbwkI\r\nCqRCoc602q3ASZxMW7uKWOcT+SMs5ZG5nSN5lfhilTOXeBaIUUQjSoWmshLc\r\nOS0PjodCNGdvSCHrXnvpTBCxDHL0QjN4b4tTfHYOaO48i4ruSnqh8Kzzh7uB\r\ng5oNbMJ7JgT+IQoTsMrYKV3aNrG+KmetyhY=\r\n=orhD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/esm/index.js","type":"module","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters options composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters options composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters options composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters options composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/src/index.js":"./dist/bundles/browser.js","./dist/esm/src/index.js":"./dist/bundles/browser.js"},"exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"gitHead":"389755ffada70753d7baf8d547c0cd0bc421b2d1","scripts":{"build":"npm run build:node && npm run bundle","bundle":"node ./build/create-browser-bundle.cjs","build:node":"node build.js && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"esbuild":"0.17.10","deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","node-stdlib-browser":"^1.2.0","ipfs-unixfs-importer":"14.0.1","@js-temporal/polyfill":"0.4.3","@tbd54566975/dwn-sdk-js":"0.0.23"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"webpack":"^5.75.0","webpack-cli":"^5.0.1","source-map-loader":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.0.1-unstable.389755f-2023.3.07-22-58-58_1678229943437_0.1962371165085055","host":"s3://npm-registry-packages"}},"0.0.1-unstable.a8cbc6d-2023.3.08-14-00-47":{"name":"@tbd54566975/web5","version":"0.0.1-unstable.a8cbc6d-2023.3.08-14-00-47","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.0.1-unstable.a8cbc6d-2023.3.08-14-00-47","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"c2f6cebf6c557f95b8b8cc587853bfdc440ba779","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.0.1-unstable.a8cbc6d-2023.3.08-14-00-47.tgz","fileCount":14,"integrity":"sha512-+JbIgsWAqqe60NKB6aZgu3cvwoKxArrxc9t1cxVWAdGSrbDxbxbIqgvVINcSEs9wvZNuVoKqPIoydG99AJGQJg==","signatures":[{"sig":"MEUCIFg4THyCR0MHaVW8OmALaSD/3l2sIUAvdXF5EywMwiTFAiEA55imW5wljnWzyOD1ONXvW+yKBlddbQwwd06lYoosB5I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14507763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCJUUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoohRAAjSqTHVJVi3vsIUEZEq1Affj1CIorW4C5OpFIPxpBs9P05l+O\r\nVkbbKuGDKN5tWcGaanzS+oUo/aDgo5J4Dx4wgOyPOT8TZTGLh3MQ1fdQt3lv\r\n5Vuswtn1stNNFfu0+EZUbSNpXNSC6pSHahFaEvkKjohVjVvxtj6v5hF6LgL2\r\niyNN10teJJ+Zua0WQD9qsjxN78UtzJ2tzre+zIIumPDyV+rqEj6IpA04iavc\r\nbN+IaV2weQ6Tyw2/SL6mVBkhgADCeucWuG0cpZU0dXUPFhRn7NfLbSi/UfeK\r\ntgBIPx1HXNbD1N3AETsvsJVwyB39Z90/7pwyVtKvku7sT+Ghh/8bAn+6nA5k\r\njo9TtolG6e69m5Eo2AROeRN1VtGl4Qh66izU8m+PekJ+jFOPxXunXyc8+kkR\r\nUIgXJm3F0FxkJtUAH+3YvGvb3LCAssDtZZms7yccZzz62zS3wgKdv0yqlwYC\r\n9S4HcwSSZzpgdPfIsULwK7qBexBl39U+FBYmlgd+jrrac8g92StHeJ7v4ytp\r\n7kbkb19brna2gcXnN2MYiO7pGKrfI/CERDywdqzrMQfs3nAaqIIETu9d6ADO\r\nKnKu0KZh4fql0dck+q3qJOGBU2qfBhYHGRB/ZZDCQccuVYezEh/Ga4j8KoRH\r\nS6YnFFHw9lDovPQGbAnMKdlYSGNYdL/KK9U=\r\n=hp+a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/esm/index.js","type":"module","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the protocols that a target DID has added configurations for in their DWeb Node. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/src/index.js":"./dist/bundles/browser.js","./dist/esm/src/index.js":"./dist/bundles/browser.js"},"exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"gitHead":"a8cbc6d6b855e4287eb14c9289d54d3d08fb187a","scripts":{"build":"npm run build:node && npm run bundle","bundle":"node ./build/create-browser-bundle.cjs","build:node":"node build.js && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"esbuild":"0.17.10","deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","node-stdlib-browser":"^1.2.0","ipfs-unixfs-importer":"14.0.1","@js-temporal/polyfill":"0.4.3","@tbd54566975/dwn-sdk-js":"0.0.23"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"webpack":"^5.75.0","webpack-cli":"^5.0.1","source-map-loader":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.0.1-unstable.a8cbc6d-2023.3.08-14-00-47_1678284052049_0.4297671428269514","host":"s3://npm-registry-packages"}},"0.0.1-unstable.b9f8d3c-2023.3.09-20-02-51":{"name":"@tbd54566975/web5","version":"0.0.1-unstable.b9f8d3c-2023.3.09-20-02-51","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.0.1-unstable.b9f8d3c-2023.3.09-20-02-51","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"dda7588876149e44397c0b63935587b5e1d4a725","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.0.1-unstable.b9f8d3c-2023.3.09-20-02-51.tgz","fileCount":17,"integrity":"sha512-fioa3ZCLJsW8iAsdrJdOOSVJvD3SiHeLisA8o53oL/K4/JmSGsR68hxu4VscH9QpkNuqEMMed0U2fnPk0SWV2A==","signatures":[{"sig":"MEUCIQDsBgHEZ3YVTNuxv41nOpfvJy8HZKL2UZMqvGM9MpSAHwIgQfM0Ih5/HjkY9wuEUe8yN2smOPW3uODQ0V8hcJIib6I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15784453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCjtwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbtBAAjmSzHMsokl3a7vxEMPCdUIkQmdn0SvL+FFVzQ8WbYgcFmldR\r\nVhHi4L0mocR0AJ2e1wCqGDVGfhpreyn8UfADOVO89wL+kr2hDRcnLhUBozV8\r\nnagACOwqY3Y3Nh22b8MKwP/JdYtIUy25jNOXsyEOLeB2ofCVmZ2NhEJpbc3N\r\nr5GuYSGtMu7Hi3XJSYoiQfEuN7XSRgO+2R2Kn43tylWSiRB+1AMJJj/Td8Xv\r\nXCxa9ZBRoIYS2c2PXTJQ2QncjWOZVXZf5jZq/Ap1BiDwtk+GxdvdsYwytLZc\r\nNjNqHNyr+kndx2bv5/ea/Xs0R06ka+FcxEoikeKU/l30wGmbnz5PFSuVifxL\r\nzU/jo8uD6XcRclZATOC5zvmaA1ZYxHvV4CM0lEqT2PF2aAcBQShdeMPrkj4T\r\nYQvnBG9Cp4Z7QbUg6L95IH/zuK8k1WG3zA4EgPzkw5QaZcbEq5hKUQflqH9o\r\nhoxFAF+lcVNfNB+QCKTgypXh1Dkd1tnUSj2lMFFGgdMsNPaAf2ZF+RCzsjRf\r\nvzdxV8Rm0+HjwWCf3DzG+DvJDdb0C/8tmdtigEqHLrjAGILHWdFGBBXoOHwK\r\nn0XqsSE3mH3n8NflRDf34q9BB+9Vw+NJbiXtTREUXpU5FwRNt5A7Kf19/28l\r\nNBdLfZGHYl8Z4ho3vfe9ELIe8hEws5hKO9g=\r\n=CFao\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/esm/index.js","type":"module","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the protocols that a target DID has added configurations for in their DWeb Node. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/src/index.js":"./dist/bundles/browser.js","./dist/esm/src/index.js":"./dist/bundles/browser.js"},"exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"gitHead":"b9f8d3ce1dcbc63e5eb32fea31b841e9b54c473d","scripts":{"build":"npm run build:node && npm run bundle","bundle":"node ./build/create-browser-bundle.cjs","build:node":"node build.js && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"esbuild":"0.17.10","deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","node-stdlib-browser":"^1.2.0","ipfs-unixfs-importer":"14.0.1","@js-temporal/polyfill":"0.4.3","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"webpack":"^5.75.0","webpack-cli":"^5.0.1","source-map-loader":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.0.1-unstable.b9f8d3c-2023.3.09-20-02-51_1678392176419_0.38201020768716276","host":"s3://npm-registry-packages"}},"0.0.1-unstable.efe17b7-2023.3.10-00-21-36":{"name":"@tbd54566975/web5","version":"0.0.1-unstable.efe17b7-2023.3.10-00-21-36","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.0.1-unstable.efe17b7-2023.3.10-00-21-36","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"69bbd324a94ecbd40dc24e08273aeaa0ffbcbc13","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.0.1-unstable.efe17b7-2023.3.10-00-21-36.tgz","fileCount":17,"integrity":"sha512-om+a0oyiHVK1GLmHqGkoW7DnpSK+YRGO5YpU/fFmMx0laKHIU0+TXjsVyvlib6feB2PlC4+aI7yMk4Kf1KtGcw==","signatures":[{"sig":"MEUCIHfkD4ha4uGO1gbGRIB3QIMB8WU5CwqpUbgwvTfoTkgaAiEAwGosfy96uvpH71Ks+s8YYO0k8pvS0O7gPQHv5Bo1j34=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15784453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCngXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4Fw//Vh7HK+uRdtC2+s/fvkqdYX5IgcwgH9Fvr+D6XIlCZaTdDUMw\r\n0EytGXg3hVR+v+P12qf4MzQ8McrwFysCg+/Y+jy5lLIARlWNCUnwBNTuI0Hg\r\neLVZRHeubOp7NcIoh7GRgMf16pSNvcLWBteEiHuN2Ar5BoxD+sbD0TVtEFsE\r\nW0oAx26kLlmREtrrbVHjhcooRJngOVrGnRUAHHJUxaA1MX7teSENAIXFfPt4\r\nlVqcs/TASaI359YFn8CYtYxti40+qtEx+KI4xMGJJaHJeP4JozHDx+sMCwd3\r\n0oNCtC6kbZbx3lif0MlUtp+i5Gxr7R+bQtsE3bEmoBrL4y/yr4Tpas84SyBx\r\n5vW3FYHmNnT5Hju5TWlio6qaAlZKbvQg2HMlYwck224jsKOnop25XjhZ9Hjc\r\neiYA8lLGTOgeQPzEdTv1idr84OAnPmzzb8cjuLnHBn1J+eoXADFALz5svG9j\r\naUW3eL1QgIOZKWqJrHX35oq52UM3wi5/3hksDv9qUk342TKAyvXe2E9z3rGS\r\nksATrIsR2LCZ6Yfhs8l66jJErUpIkKYyYO5rgfIj9Bwzs3J+82TeBB9M0VRw\r\nHDbqBfwm9h1vU0OaDyMtP4DLgq7+YqIS+XXs0kzFsDiisqBT4kEs5J1rCqxo\r\nX1n9gVDzhnj13vbyW39hlTcbrjwX7Ih2D30=\r\n=apqf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/esm/index.js","type":"module","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the protocols that a target DID has added configurations for in their DWeb Node. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/src/index.js":"./dist/bundles/browser.js","./dist/esm/src/index.js":"./dist/bundles/browser.js"},"exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"gitHead":"efe17b7f870f957bb7a2ac55be2722121c5f73cf","scripts":{"build":"npm run build:node && npm run bundle","bundle":"node ./build/create-browser-bundle.cjs","build:node":"node build.js && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"esbuild":"0.17.10","deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","node-stdlib-browser":"^1.2.0","ipfs-unixfs-importer":"14.0.1","@js-temporal/polyfill":"0.4.3","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"webpack":"^5.75.0","webpack-cli":"^5.0.1","source-map-loader":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.0.1-unstable.efe17b7-2023.3.10-00-21-36_1678407702815_0.5045991988659593","host":"s3://npm-registry-packages"}},"0.0.1-unstable.a530a17-2023.3.10-02-08-09":{"name":"@tbd54566975/web5","version":"0.0.1-unstable.a530a17-2023.3.10-02-08-09","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.0.1-unstable.a530a17-2023.3.10-02-08-09","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"7a4ea22da6a4f8ed3f6db5e23165876594545594","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.0.1-unstable.a530a17-2023.3.10-02-08-09.tgz","fileCount":17,"integrity":"sha512-DcQDG5hNLGvYUNyI7IN+cPbgpom5PLIc0oqEsEVH8Zp1mYVAU7EkduVJKjwxRQ9Utkak7QD8FUi4f0+thJRMSg==","signatures":[{"sig":"MEYCIQD29d289o0MUBAtMsFRhW2Xg0WTa+rBfIi+WfOgNnDo3QIhAKEg3NpUNa+VWnhxP6SkRzDJrpERO++dme1JC4Vk6k6d","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15784453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCpEOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSmg/+Od65KpD2oCRhCU1LIZBP+KDf3nmP4z6ATo97Dr8VSkAstmM/\r\nNFJ2SYzw9OKFf0AV1KMs9/vxK9PD02Edxp5Zwh7dLC+5ym0LRD9ozMrYiUtY\r\nobkmgooqppiED2wAkMhKtfW9f/hzwg2x86Rz/+VvYfLcCivVryVHQiujdrpU\r\n92CvbVIPnLzsTFcAeSUV1r/015rL3YK584W1iwpbWP3xVpjki6MvoJUGJbRS\r\n/5dUC7kTvdQWwY5/2pYdMILKTnO4BGpXK2gwikSwGZafSJzq2LCd6Vqd1pNB\r\n3WC32rY2Ef4I1yEGFNa7cBOjSZwCpEz/EoJZHI9m1nkYKRJnKGbezi0StWH5\r\nWJC+gR8hP6+k2IftiYiatV6gB0//nV0t8657ujseY3zJGjkJAP4WKd8gIh53\r\nroJiKvEDXYfz8NWJih5gXJqEmlea5XledNSm7cP7RzCqInADqt6/Y30raLwo\r\neXkURg7NDGFOWpVtifqHLwSjjDXxOXK6lZnBaeRXZZXVJRHr58rbZ0ju10uJ\r\nMd8Oog3aQkZ66hIgCJEw5WphnsyrW440JBiOeqy39twyKSzcxODRNJV8Hzlv\r\nOl5rG2b8Bo4DqXnuHo0VHTCJkorgib6HpRVMdHuZ6Usu/Ke24KaLaeQeDj0o\r\nS7qHjJ86DFZVcpF+9WddL3h8D/DqDFgwN10=\r\n=2j5x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/esm/index.js","type":"module","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the protocols that a target DID has added configurations for in their DWeb Node. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/src/index.js":"./dist/bundles/browser.js","./dist/esm/src/index.js":"./dist/bundles/browser.js"},"exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"gitHead":"a530a171b78e1a4987ee0d93aa0ecb19ad588e19","scripts":{"build":"npm run build:node && npm run bundle","bundle":"node ./build/create-browser-bundle.cjs","build:node":"node build.js && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"esbuild":"0.17.10","deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","node-stdlib-browser":"^1.2.0","ipfs-unixfs-importer":"14.0.1","@js-temporal/polyfill":"0.4.3","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"webpack":"^5.75.0","webpack-cli":"^5.0.1","source-map-loader":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.0.1-unstable.a530a17-2023.3.10-02-08-09_1678414094042_0.1452364599226721","host":"s3://npm-registry-packages"}},"0.0.1-unstable.78e6bd7-2023.3.10-14-31-00":{"name":"@tbd54566975/web5","version":"0.0.1-unstable.78e6bd7-2023.3.10-14-31-00","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.0.1-unstable.78e6bd7-2023.3.10-14-31-00","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"611d00d102dbca679e23b000ebd47265dddd0974","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.0.1-unstable.78e6bd7-2023.3.10-14-31-00.tgz","fileCount":17,"integrity":"sha512-ijxm7kw5+lnKV4MYzrQRan8RUI3rDVD3DwV+HlmmrahcEB9NeBg10HAoXgsf6vBxOwGJQ0RRbeUGolDgJz9odg==","signatures":[{"sig":"MEUCIQCb3AUEHOC9Q2sMp7YEGgTC2CRgZ700Tb6cK3VzxU6CsgIgIyrsmq7uigcPq4mpcBScjqdzc/Fi7ZiCukx36TnJ764=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15784373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCz8qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYsA//TgFwWquSEg6X4Q4keeyUMuthzWDViU2v5uIdd1j0RY3+NDOp\r\n7ldWUS3HFerwKqK9w0lRXCM2r40/I0f6LNJe9vH88JnGjkvFOdF6AOQ/bxcq\r\nvx3VRIp7hxjCHWQv8txHiXG+XqS2DqjzNcMR9T5sbFxNsAsMT9+YQzBwytUx\r\nw1BRkhcwADrZZCPcBn8mV4seScD2GDN6onfW6lyHIbwIyfS2PLR7YnCgfCaY\r\n96Fj3HnZ9Z2C6MOpNykPDRYjPYa1BLe70uifUXPjhAjcgvcrwEEtGCYyhHcY\r\nOgGrsk3mEu6T3r+TscLgvK6EtNjp2Qloxd2KT8u9M7sEoFFzD/RuW9BmVUm9\r\nRHvmI5xQLFrKoWoP1vcDFp1OPxQdplfbnuP2fJllbn96fkDfTnXMi5jH0Y7L\r\ngoNSPMy3FGAVIlvqgFblFCVCwNRLEILBmttT/rJSXfTrUzxoj1w1emO71gIL\r\nU4dHrVl92xeujcsg+Q+ttyLuxd3GAkvagMU3t8VQ3mOgYRIDwhWgQBa/1qWg\r\nWuB+1AkwpCK+8qsabI0TWFDuvSAdXvqibkYwrils3gDxwV9L80QhFe3C2FYS\r\nCUAUKPYAGVHDyj7WqRR1QUFCPv7JLHXkalpCHXH5h4T/I+p29ypR4GyN07VY\r\ndKuwhqp4LeRvjTWcXYEThZNuLqvFCQMnzDA=\r\n=tASr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/esm/index.js","type":"module","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the protocols that a target DID has added configurations for in their DWeb Node. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/src/index.js":"./dist/bundles/browser.js","./dist/esm/src/index.js":"./dist/bundles/browser.js"},"exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"gitHead":"78e6bd73d13ba2538b6988f5fcb1ee340a0439c0","scripts":{"build":"npm run build:node && npm run bundle","bundle":"node ./build/create-browser-bundle.cjs","build:node":"node build.js && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"esbuild":"0.17.10","deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","node-stdlib-browser":"^1.2.0","ipfs-unixfs-importer":"14.0.1","@js-temporal/polyfill":"0.4.3","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"webpack":"^5.75.0","webpack-cli":"^5.0.1","source-map-loader":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.0.1-unstable.78e6bd7-2023.3.10-14-31-00_1678458665813_0.2675000582177043","host":"s3://npm-registry-packages"}},"0.0.1-unstable.d594a25-2023.3.13-21-14-34":{"name":"@tbd54566975/web5","version":"0.0.1-unstable.d594a25-2023.3.13-21-14-34","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.0.1-unstable.d594a25-2023.3.13-21-14-34","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"529eff1f9cb7a11aa633137e060abd715c6c941a","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.0.1-unstable.d594a25-2023.3.13-21-14-34.tgz","fileCount":20,"integrity":"sha512-n9s3UPASIWvr4fpDkb0nxPAyyhItzmTEaFKLw9lNkWN0DkEH9b9cf8EOleQPHxJHjlq5sjm4k+TFAoOaqUuGEA==","signatures":[{"sig":"MEQCIAFIpjhA4+prnSOAt2JJzYY7RreRS4KxwKuJ7Ef2nrVaAiB0PIjZGpr7gDoQx56JLqN+GVMRIJH/q/zK9gDsI36/LA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31552623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD5JEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9+BAAk4vMf6ogBu5pFgefCXt9fh8FJrH/FHPFjBaLWRHHi4dSvKEl\r\n26A9mznmotf6oJQzdLGOQwMVuWk0/kCttzeKGwHJRa6o4zEOC+p6kaHmcJht\r\nxIOnpVATYklOAmSqlH3KCci6uTzea9CZjIE5MPCq6+YV6Zyb9wQrHswwtch0\r\nPxivevAdEei03hpvhQS3cF7ytXGef74nZTxfcBZYAghh1ORe/mJIpV+lZsaW\r\nFDlVAWAen8uHMqqNaL8rwmtO9VACnp2TRFHzb3o3oH0u3dHoNy3YhaqE4Mkb\r\nRd5stoD6K41SY48kw0TFJ/gJCdT1wTGAN81wmwpYHFcgE+bNrxzETDC62GA9\r\nPpW1oqLPHWXsvLqL2Du2kOPDaLkWAtMRkATfJZXrh7J7De6zRTbLuFDJGRj2\r\n5XtK4nX9i2TaOhWKPz0ifONFVRe+1j+DzyZl3WLrTmPbMbYZLjG7ZpGlXB/4\r\n+OMNo+WWTBZ6FRFfuk6W0E9lq1WRLOGKmPOWA4JiK0jnWbqgKxL1z5SrZFiu\r\nGzZu3LnXAdk7YsPKrMPKCYVQOuR1ZKjVjTgKPzisanq9d9Va/JR8GTdTO4w0\r\nPxhtD4xJo3Y1rKrMcSRdT+7zHD95j2iRV43xyDKFnSDvr6CtLOMceA5touQl\r\ntnn3I4UhNxHU6JvV5PKe0DHXJalAhMkGL+M=\r\n=AZoR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the protocols that a target DID has added configurations for in their DWeb Node. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"d594a25ea57dd8e51420e415842e16152cbaafee","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.0.1-unstable.d594a25-2023.3.13-21-14-34_1678742083611_0.5654909894900839","host":"s3://npm-registry-packages"}},"0.0.1-unstable.d594a25-2023.3.16-03-06-55":{"name":"@tbd54566975/web5","version":"0.0.1-unstable.d594a25-2023.3.16-03-06-55","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.0.1-unstable.d594a25-2023.3.16-03-06-55","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"f20673df233e42e1f1c6d6b77907e78373ab5da8","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.0.1-unstable.d594a25-2023.3.16-03-06-55.tgz","fileCount":20,"integrity":"sha512-/uWv1Hgh9ghbt12dkGZJgZUJFkhaplAVl0VxJn6Ts/GL28bBvPgfgWJjPMvTsSWR919AB/UxKrzhbDa3gxeFNg==","signatures":[{"sig":"MEUCIDEGNWwTGNRXab2xF+ioWlhuEX5qDF62CIJGZR4RmMAYAiEA6CaOCtrBNnKW8QuC6463udfZFIDW1+Nfh/RKXxTuL2c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31552623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEofYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmremQ//VPM0CRLpamsZRNhjWjs4Tn+fYstqjrq2w4p632G0eiP5qhYo\r\nsBE1Mg9zxhemLTwdFF3xNRVz94tlUCpaAjvQG+aVH3p12r9iSvsVRA5gWNni\r\nX/ymUGsi3xel7vGmWL3/Ate8cmn7tASgesx2Hsdmmlrozk2isB4rC6kqim9y\r\nbztTbhVGSxGpvfcdaJ5WC3fifBhccM+TwePb66PK5x4hkguahUxHBUTkibYd\r\nG0kffzyqkW6AfiPbnkShfdmc2icjhQoNlxk/vb25ML2GvOH4gDuCPEpn9XcO\r\nkIVUGVo2VXC9TRgCuVzeO7FvEYRPjTCsW7wXpv4uSVtvF8zAr21HXLbKbJL0\r\nxGqm/A4B/T9fzaiPOFgVIorb09AN4gZbMJd3122QWEtWML994eAVI7T3Dm6+\r\nMxYaHeihI6nR8boczRxXyZYb3B2Phe58iHbZ1nqDPrUdWGuAZebfRk3N/tCa\r\nr04iDaH2rsmVQSykLFzQYgQtNFx0+r4I4TzlYkzjtpgRC7Y50IF1DLtUzRk3\r\nkWzgXlKcqEvQBqd85hIm/ZeXUUowe3G9wV2j3NAaAhs/iZ/fBzHnWsFi+dLl\r\nzveP86I9rAFq8zMM+Pjz588X7lkMp5JVmC7XnY/ygZ8jdOYzlO3MxdAInhxb\r\nCqLUfB2Ltj0Q7cqv3EjLkwa+Z+UxFvxzyL0=\r\n=oWIF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the protocols that a target DID has added configurations for in their DWeb Node. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"d594a25ea57dd8e51420e415842e16152cbaafee","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.0.1-unstable.d594a25-2023.3.16-03-06-55_1678936023768_0.4123242096568025","host":"s3://npm-registry-packages"}},"0.1.0-unstable.9582961-2023.3.16-03-23-32":{"name":"@tbd54566975/web5","version":"0.1.0-unstable.9582961-2023.3.16-03-23-32","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.1.0-unstable.9582961-2023.3.16-03-23-32","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"a6677b5919e705943effe302ecd2d606b8a0f0d6","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.1.0-unstable.9582961-2023.3.16-03-23-32.tgz","fileCount":19,"integrity":"sha512-EGh0SrmvPLJpKYzM/H0o4NWy5hajloYzqJ0DeToO5RAijOUB5zbSFeRPDdsp9UmfqtcYpfOU/d2fJr6Y7beTKQ==","signatures":[{"sig":"MEYCIQD34EeSFRrBIi2gKzCU453f2rv6Ax4bxsKwsn5/hlHx2wIhAOSBJortXoaXCteWPXd98FePLByUGs6iCcU4izxK3+nX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31559973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEou9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrysQ//VgI3pcjgnN5RdQts19UiFEL8hjHGcUKUjN0rpuENopyFRSkV\r\nr89YdD3LwHwFAyRIrkxBfUV07+HgvrAYSE2uqu3V3vY8yehugOx3iQYlHYzx\r\n5Gcva3EsHr4vA9zBQK76Dl7icU2qGjg8JDmHeaPO5SW+bSck/hqh6xYKJ7/b\r\nnqt70BDY8btJfkBO3P84mkybnK6XvWB4m7QjTsawg6vJyFV6EBvxOhMFp9lG\r\nreKrRLftf4p2UVs+IpOQsCOU/pPv/VApe2Io+yz+q0n/KIoFzS37frqiJ/7/\r\n0jVRDSpJNL7fOb7YTAyYki7ivGTQq/wDE05ThvMIEgbAxhczWnOkcDZ2jcVo\r\no4s5/L43zJ4GIe9YxLrw2nrnAYuO5Yv20Pk/HkYEhYqH2v35w5UFZs/twOd9\r\nicrzRHBR8c9qzfxhSuUOxTcaNsu5T+HQsYZCxY1eDBlLb88nkLyX89IubpYR\r\n2BFqcAtDY8ToCVXuD0/sNSKmgTJZIGcpF1159BgJmKVg0kYdPdalNNBKHZnP\r\nCahPhrUJiGSFVFB3sMca7Js6WPH0X+8nU/f+oH4Q1ILrJOKeX0zeT4OAtCOD\r\n6GD22jNzCxic+H4jvqN5Gl6SwfMLvRcrCjl1iCdCo7iVlVJIsl9HLzALV5IN\r\nFRoqiylv1INpWNGHpU4x0LccPJRrdBOfHso=\r\n=D+uh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the protocols that a target DID has added configurations for in their DWeb Node. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"9582961e231b38d6e5bc610f02bddb41b871290e","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.1.0-unstable.9582961-2023.3.16-03-23-32_1678937021553_0.5809791507730193","host":"s3://npm-registry-packages"}},"0.2.0-unstable.03d4273-2023.3.17-04-09-58":{"name":"@tbd54566975/web5","version":"0.2.0-unstable.03d4273-2023.3.17-04-09-58","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.2.0-unstable.03d4273-2023.3.17-04-09-58","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"ba7a3ca7910038c046c0f533e40b2348c161bf00","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.2.0-unstable.03d4273-2023.3.17-04-09-58.tgz","fileCount":19,"integrity":"sha512-62D23C5PYzYnMFI9J30DjEhGS5UfkrlXXrP/8Hgn6S3OMBk8dVHxpauVnFDm24ULSdBE/EmMsWyKS8jc8Sn20w==","signatures":[{"sig":"MEUCICbVnVDr36v2oBQUJgQfYa089nKgwE5fKNlxX3kkyiVOAiEA4louGJ5cxYdy7pM503Mdc2+w+gtZAQLYw17gHoE+Azg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31561463,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkE+gfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7DA//Y4MautlJWeMnpqfEzxoED+7x3ko1kIOJO67QGrYfUWVMLzfx\r\nlSlukejdSUq4iVvYbklQ38yCVl2YYfJ6hKyGIwEXpKXK6QxuVwVB2HX5TUaV\r\nADs3nS06eHm6JIPvIPoJioPwE3476iKf1geUqK+0Zly7DA6bbAG49MOuBV+x\r\nQbZbmQV9XnZTwy/XjrzaQGiiFJGWQsWZkeXz8hRrW5lN/lDG6byi2dZRrfH9\r\nJyrT2fHi/N15pBzMQpC4chmhJNsAgalX0dzcLhNGW0akbmSxyDQFG1fXGb9T\r\n7wwm4hHfwPJCqmJplDmAvHxBf3blpKf2D6kuGtFW4m/eqHB1sXkdj3XuJWkU\r\nZlOrBr9c+G74s9W2kgNhnSQFi9fYjdL1pQ/CBFXFvyUUBajG+WmIMRIGjowA\r\npjqP+P2iITlT2E/h2TPvZ/Mgz4xrTlRu8FvVcASMSStz6gxeNiIUaPhsZnUz\r\nxE4iX1uw/pq4/Up56ZnTCwdpu6YyiCuVs9xA4rj0fsOSAQ3y5Cj3pjPB0Pp3\r\nZ+sdQa1dzrp93vYpVKF91ea7FIfi8ddQSoJUSsmExrREvPInVnqz4yZ0OOOW\r\nKVChveUVQMySxXs/okD9hc8sD8KYcH5coP+t2jK/OgakG8uWMw4RA0uZRqrS\r\nIcjNsfP9vMiYHHzI53OprkdYVb4HJLNkZ2Y=\r\n=GgiM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`Web5.connect(OPTIONS_OBJECT)`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method may only be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\nThe `connect` method takes an object with the following properties:\n\n#### **`onRequest(REQUEST_OBJECT)`**\n\nAn event function that is called in response to a pending connection response being delivered by the user's identity app, composed of the following properties:\n\n- **`pin`**  - *`number`*: 1-4 digit numerical code that must be displayed by the app developer in UI so the user can confirm they are connecting to the correct app.\n- **`port`** - *`number`*: The port number the identity app was located on.\n\n\n#### **`onConnected(CONNECTION_OBJECT)`**\n\nAn event function that is called in response to the user accepting the connection and sending the DID they selected back to the app:\n\n- **`did`**  - *`string`*: The decentralized identifier sent back to the app.\n\n#### **`onDenied()`**\n\nAn event function that is called in response to the user refusing to accept or respond to the connection attempt for any reason.\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  Web5.connect({\n    onRequest(response){\n      document.querySelector('#pin_code_text').textContent = response.pin;\n    },\n    onConnected(connection){\n      alert('Connection succeeded! Connected to DID: ' + connection.did);\n    },\n    onDenied(){\n      alert('Connection was denied');\n    }\n  })\n\n});\n```\n\n### **`Web5.records.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`Web5.records.write(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for writing a record to the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\nconst response = await Web5.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`Web5.records.delete(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`Web5.protocols.query(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for querying the protocols that a target DID has added configurations for in their DWeb Node. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`Web5.protocols.configure(TARGET_DID, PARAMETERS_OBJECT)`**\n\nMethod for deleting a record in the DWeb Node of a provided target DID. The target DID and parameters object are required arguments, with the parameters object composed as follows:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `TARGET_DID` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst response = await Web5.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"03d42732d12f8d440d9083a1152e435dbb8ea777","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"deepmerge":"4.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","multiformats":"11.0.0","readable-stream":"4.3.0","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.2.0-unstable.03d4273-2023.3.17-04-09-58_1679026206786_0.3648157150062612","host":"s3://npm-registry-packages"}},"0.3.0-unstable.f314cd1-2023.3.21-18-36-30":{"name":"@tbd54566975/web5","version":"0.3.0-unstable.f314cd1-2023.3.21-18-36-30","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.3.0-unstable.f314cd1-2023.3.21-18-36-30","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"d5407fc64c4381c970ca683c958e9b8094c09800","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.3.0-unstable.f314cd1-2023.3.21-18-36-30.tgz","fileCount":28,"integrity":"sha512-IhiYlnfQdEtI175lTgBCYvv5o5F2w5YGx2vPFSPwbSIHB6HaIjt0IRyqYjRanR+TmkrhCZKZCHuxJ2Pu08Qi6A==","signatures":[{"sig":"MEQCIFk2V5GfmJSKZSsItfgfafTvC01S2f872sZ4b11iZdIXAiAOZbGoBWldmGUZwWtYsRHVKUbkVRmPKDwTyixUFUDg4g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31586951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGfk4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTlw/+L2h6xEzU4bCF6BsNtQYYCPtZmMMSuAlSYBI+3T/mNXVNlFIG\r\nYl0PqkLxLOXRBRxnXoDHr/vGPHnGOWcpzmHb1cqZyd+I4K1lc7QCFEJ8JR4p\r\nXUcGupiOJ901hlI2+EE8O3QCNW1RPEHFSUZNqFTn9p/ZiOR8hxlUgrPidIRR\r\nPZaLGqrHRMMNifheFInU5UzHl4rGNdYs76GwmlUGpuxZltHFcSJhutauwaJA\r\n56GNzQoiYXAdWTwoIYBj6QrJMu2eztJFVjbFVudacTF/BJcIwz+Nhrc8HggV\r\nxCbAj6fLULp5AhbyneIf8r3zgTi8b7mgrw1pxPY4BuuhGFEZnDkf1eT1hl6t\r\nHBSjhyKS2/o36ZO+tWeiEmjA94nsb0l3SGF4xBrE8rgXdC9enZyqpbBlXBgu\r\n9cKSh6as1BMMdbqmwEVFMLI2lv5HLE/nOchCsNLP2V/ViY6iVP0RZpiKhk7W\r\nhSgb1CfeOW0N0y2xwjmx3uRypQMMrVWH1Eh2cO6r/KaL/N6JgV25XO6Twu/4\r\ngsSsJAdmiGzt0WwuFZNncQOl8m+RAP5TzMFZmuWaANzHHn2dH2voxoKzSA/i\r\n0pUpx+ab5mRDP7DhVtcqPphTNrXsLCbViL0YaeCgy5+ffGbOLQwyI4sLnkwC\r\nQZClRep/wczogtPhFDMlGY4CRlUrG7ynVEE=\r\n=aehN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"f314cd1bd8efe449fc9e6646266a9db63f2a8c71","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.3.0-unstable.f314cd1-2023.3.21-18-36-30_1679423800095_0.4286749878840461","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"@tbd54566975/web5","version":"0.3.0","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.3.0","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"8557cca9ac9d13877ed075f5e599b7359b3f3788","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.3.0.tgz","fileCount":28,"integrity":"sha512-ZnK0JnoHYyUBYBHQNEx7qtamwfibR2louf+EBurgOX09hM+DZYZkomHMTu521sEOnsocXCJRPwX6hg7C0d0+nw==","signatures":[{"sig":"MEUCIAZNeoHkQPtg6FU6TUqRiYYh81miAa7EsVJ0y0+C+ltAAiEAkVu1CtJvmomad+SMmVGc36GRayChp64ZGsAQ8mhmDM4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31586915,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGfwrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAhA/+I35fK9duD0wxwhaYlAdm0EmRhGJnMs5NXkNZSppeD7tlun/c\r\nz3gfiUBUGXLfTXItx2rB6HL1B6cZmg0VeA35Z9Vr3pVdTf7Imh3xd1aYZQFw\r\nZjDP6RG0tsqM69ueuhbEgy6y0dcRFMQLSZpigciqGkrTV0Eh7xrKEb1fA2vb\r\nDxdKPZQiH4wQ4nKheVCEeV7iFn/Wilmvp5bhZxDNocuBBMRLo0nm4tpS7zY/\r\nsXHhieZPxxHi1bBGVIKgemArG5VgJos5aOSKtgflgsedUha+1x1ZAg+2HVVO\r\nq1puzL8hFX9vpKU6My5bHkwr5C3TnvYAkw1yCh/mXVTh/UweW02MVWWJYq3H\r\nonVFxdRHkFkQGN3W+R+DoFwS/4+q0UAFqkw+zZWJAnAVdDkaioCq1BcupnsL\r\npMoFWMUHIA/LDREj4fqJGpx+A23XyegmLjObvLolVNhy7C8LMPua3W51qk2h\r\nsESL53jvLc3/bK7UP1sBxh4168bJJouku8NHZNNXq29DYv7rc2l89WdNeeQt\r\n1OCHjP/xcIo7yEIRXSwTFDgMSGqLjC+mLzqbZAS7ZdSjCJx/lr3BpuGws9N4\r\n/tvzD6ulV7Q0slbnKTL4jCX4wnNCTFDDo7maSgz7zkJFRdyvypTllmkWun8I\r\nUheGXAziIrY7p00rZI4v7TA3fNGhkKodQQA=\r\n=hlbz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"f314cd1bd8efe449fc9e6646266a9db63f2a8c71","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"9.5.1","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"19.8.1","dependencies":{"tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.3.0_1679424554774_0.5969928122098698","host":"s3://npm-registry-packages"}},"0.3.1":{"name":"@tbd54566975/web5","version":"0.3.1","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.3.1","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"63fe69ea32bc006ce7575f86367fa02150d6a80b","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.3.1.tgz","fileCount":28,"integrity":"sha512-PJhU/iPm7PkmxhRlqXP6cC+2MQybkzDl3OYMBNDI73bCOQkKA5dZ6d01NkrtMd6DWJyCr6p61ZMWDMCKim91RQ==","signatures":[{"sig":"MEQCIDMwuIVc0hqgfgn3fD35IB3iLznG/sujvI5N+XDx9D1WAiAF9aFd4ifLnQaffa3O36/7Lk+0+gAgY47NsYelSyrtoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31586915,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGf0jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGjw//fytjUJs37ty6m8oLy9ACQYA1TIk7k1i+W3aUdrC9/ELfJcZR\r\nifUH8zo/GAKXcRmYmuY3XyK8FQ7ehW4v6R19Yjn4eOahxOWlg/3HNvYqibCh\r\nDFcMowGs7rgc0u+dnamfF187NoFxdMz8dYPq1XoKAlouNeDwpdDt9GspSBSl\r\nYVSwfdf2tgJQZZpEje3zRJI9A5HluaVfRzuzzhhQBS7hT0HBa6cIZ8rKA0Y3\r\n0poIfkR191RlGzw0Bapj+kCIf22eK4kaFpbflT0J7kxZyVmUwfafQgOulkon\r\nLi5Df+YVhe+A7WG2POLkb1SnAxl3cevTBh6sTGA+kgAJPp+n5PJvluMxeUgY\r\nkRxt3S+kbU/IeA6iPLXZBHh/JkJRlnA5u/zksGTksxj+ePrDlw8glg/QLL3d\r\nfbCFMvFXLOP5G2ivyw+V6U8yub9BFpWD5A40K66DQvrPA+Fou/Mii3iw+PSK\r\nHjjKAg/8J1yl/FGeHiIto0r/3yflArsP5UZ25X4j3f9b6lcYIjzM6DL6Fnyk\r\nUhu5I1qGR0Do3hm79PTdkZLWhO/m7huPbbKEpMSW15ollt7UxqEvuJUD7NWd\r\nvD/kVxJfhof5IjxdxeqKvesJ3oD16GdKY98tWcXYs9ZqevNr0M1NLSVbJ8ba\r\nTfVJ4rFDjxgA68rDX0yFHLmMlrN/uV4ijFU=\r\n=Kk2M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"edb0d0dc39c9697136d206b06da4ec0e5b2f9976","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"9.5.1","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"19.8.1","dependencies":{"tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.3.1_1679424802956_0.8109792139585956","host":"s3://npm-registry-packages"}},"0.3.1-unstable.e2dfe57-2023.3.23-19-07-37":{"name":"@tbd54566975/web5","version":"0.3.1-unstable.e2dfe57-2023.3.23-19-07-37","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.3.1-unstable.e2dfe57-2023.3.23-19-07-37","maintainers":[{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"3c12f037ba9d0355b68833573da3c956c364eec7","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.3.1-unstable.e2dfe57-2023.3.23-19-07-37.tgz","fileCount":28,"integrity":"sha512-bLoN61Yith4D7Im3d/Ske7zV9dOlH3P2foKu/9sjYR/mM4LmafSZhK9YGHh1/yvGZHjh6wt1H7G6ysVtrv9Xxg==","signatures":[{"sig":"MEUCIQCpQleyYs9Xm098Y2oIHk+mNK2cmc9YrvTRzt04RmGONAIgSUe/s25MOo7bKT/EAdumeYk7f5xMGHFLFUuGQ4RI1TM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31614953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHKOCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1TQ/+JAhHprrTUS1YLJnCRHISu7cmA7lr72GMKmd3j7sUXd7GcJBc\r\nEcHcgCLKKqFKJUEkraWXhUyee9MD6NgCN/1ZXRsGLXANNySgKJYmrm+bKLv8\r\nc4zPeOIAamEM5NJ8vsuAzIVFvuiQ77672FTLmdSPmJ/7S0TLAJBOAD6kZ+ij\r\n5+69WD6B5cPLOajMBfcuqY+QXIH2VDyHOYBnultNv/+eTW0pEc4ntfbHqKpA\r\nq1Pt1cjhnkg/az4mTmJTsD8XhF6PgaMQf5CeVk49LJWzDR0rhUWtwOurqioV\r\nDYOUjCOIaCBNAmjhhXUEMk2dw/NEaFKGj4obPcnrULyoRqFF7WMgbL5RgEL9\r\nkyoTRI0wQ34OOd8kYDO4lAxqmEI0nbhRFncluCTTd0laEWXF2XxyHPK55Q8T\r\nxufyeeou3KQG/jCgdEDLhv77fqQRxnbUzAejAaxZ8mblXDeO4uW0xOyk3/Ft\r\ntOcp8eDRDaAO7iMR3xIsmYS75QHc+js3TZQ12HdzL1qunLj61VovR8w5wx+i\r\nSRMuUEhioLIQVzMct2Ns+2WVFs6KQiBYfurPUCiwMuLvp1swFoOZ24WxvmSj\r\n8Jw4JdlomUlcMkeYIU8Crp9x76PVjpZjQ4ptlJyfatqB+MmitRvN1IQiwN8l\r\nuBAqVK86oKG/2XsSabK3CIPH7XvCbvNsT8M=\r\n=EKHm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"e2dfe5797f7562724099a9ee07d744614d0203c2","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.3.1-unstable.e2dfe57-2023.3.23-19-07-37_1679598466245_0.11303432814012138","host":"s3://npm-registry-packages"}},"0.3.1-unstable.3fc6eb2-2023.3.29-16-51-06":{"name":"@tbd54566975/web5","version":"0.3.1-unstable.3fc6eb2-2023.3.29-16-51-06","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.3.1-unstable.3fc6eb2-2023.3.29-16-51-06","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"8ddb6e43a17db40223914d264b41e8500b0340a6","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.3.1-unstable.3fc6eb2-2023.3.29-16-51-06.tgz","fileCount":28,"integrity":"sha512-usLnhkGqSOHqo/OZXC3+uk++GKEOAmaYKKd3qPoxL6T1FlF/DKG1132LKPYsLgU86+6gNMOcZCcOkvuqZfqA3w==","signatures":[{"sig":"MEYCIQCiHhiPma1Xky0N07HVJiREsCQcaDnsBSq3/tdgpfl6YgIhAMU42t4BwLc8K8eFcvAwU3q06HTcD7ZGUS5jUNxIE7PW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31614953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJGyDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+cg/+K/tG6EdPWmivsxfZ911uXH20+iIRXqu/yrzoXARe5Md2958C\r\nSMIk4l90vlRxb3xWy1UG9jAKnm812d4cvVZziMie90lbRDrP07apHxW1Wwvl\r\nbO2uD9NXyppxIyOsscPl8DL6B9L3mykH3TdmKNaoBHvO42BwKBF34lhQYSBU\r\nAHEN28qn/j0p9h+btGREcMd4IkUDOM4k06iSH28N/cPkdL65fHT8TREq2pxe\r\nJMODgnqFeq/zEGZ2rktm4WSTcBVQD3DBFfSfHGDos5V024wl+DkWFJZIITTq\r\ngUSs7Hob1wO+euVYfscVvUTxfQXfvTbNW9juLC8S68llPjjCcRywTzAlb0Nz\r\nW/wQYHkw1W8A/dQDjD11uPhOZrR1kqWzJL5KTSTYWvVDgaHsP0+PjCpgrbaT\r\nSlTOdWCMjN4GTu9r6wMZKkpaoc5u+hlDJWuFd7uoDDL+7NfnyBF9G4hzWCFY\r\njzNCbw+QVkXX1V5PrnsQMbBqwHtA1BMYU5jnGxQPfkXtC5PWCjKeJvjJK/AH\r\nMjT7/UQnP/pU/eq7Rye0hLY/XdASAlOHbryu8KklepoC6oXDop3QRsR2SchX\r\nM9FxwVhMZlfZ4AfRwq6/qxM799zIS4y1TFbGysRXegdXPjkPEwIWXAGZ05L7\r\nCeNnV/G/b7aoIhqSOAEOPpaKX8JP2nQRKKA=\r\n=RzYj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"3fc6eb2627cbef56dcff0a635a97fe31ce334bd0","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.3.1-unstable.3fc6eb2-2023.3.29-16-51-06_1680108675280_0.29912564785439333","host":"s3://npm-registry-packages"}},"0.3.1-unstable.bd764a1-2023.3.29-18-44-39":{"name":"@tbd54566975/web5","version":"0.3.1-unstable.bd764a1-2023.3.29-18-44-39","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.3.1-unstable.bd764a1-2023.3.29-18-44-39","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"bc03ff35339a5bd041c737ff5c60600626bc55e0","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.3.1-unstable.bd764a1-2023.3.29-18-44-39.tgz","fileCount":28,"integrity":"sha512-s2jXuJTqK4GNVW4KQ2yX0Y4uvgQQUlOVji7D308rFYd4QhVdo8kAF/8ZagFSmiLuLRumEjeglnlsClssPf9M4Q==","signatures":[{"sig":"MEUCIQDVM1c5X4svNR5bZWAfApn2fps5aqH5GAf0ejaoHFqt9wIgWJGlGSH1GztI3i6+Yq9vZQ6/2xssPjC+t1nTvjSKaIw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31614953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJIcpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1RQ/+OPf8pAPDhm43lHS3qeVk1bT2one/qLRyDykyVoJDx1N/9V6i\r\n0qlC9TaYjsfiBPnU50S8qjaFik+KatBU3UiA0zGl2X2n/Zw6mNYu5KpBWHD8\r\nOf9hA/GLwonXTVbzktDyTe+31Gi4jxQ+tsthLmAnsMO+U+dqMzjjRiTFL3Or\r\nMKV0y1PRJPXu/hS1+SPwismouKdfMNxK1jAY4R7GKiAwUROKPYfbJsXahizB\r\nCwqDHz5DslOiqDQ/wXwX0cm2Slaw8NLzpB+EGbqpfzDZ/QBqTaIOH2DtxLm7\r\nGad/siu6LsuDQoGkucjP/BKmLZO87A2MTBntx+A9Wad2MMuTVRVA2efGmo2K\r\n2/i90CrXTR62op9qbvqg+UBohW8rVIGYxAqTpeSZE2Um4HOEMYuRq4WWAK8e\r\ntb1QAkW0odf3AtXoLJE8k9mUKqUufLnagtQACX8XzmBnlyGq1rprQriD535B\r\nTNQs9tjNUojjiG6/KN1xUbnSLNyH+3Bxlx1E8p6YoZH2aCyb1zYGvgQ6T+w/\r\niPOTAdJVCB1qNdwTX/mfLAPGnb+CUms5cunBprI+caIOATSNnD33ty7c5L9f\r\nH2OcW3dip+68ap2TUxawKaVgPSO3xsxFt7EeqrlzZpULbYh74kS6sZQKdefk\r\nOZnx2WdUbRE6fspviPA6qwxwVLVWUrOQtZ0=\r\n=8REc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"gitHead":"bd764a190a3f949481e471b728be5c7804bc7bb9","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo {\"type\": \"commonjs\"} > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.23","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.3.1-unstable.bd764a1-2023.3.29-18-44-39_1680115497138_0.36848177878545507","host":"s3://npm-registry-packages"}},"0.4.0-unstable.e6470ce-2023.4.01-19-39-11":{"name":"@tbd54566975/web5","version":"0.4.0-unstable.e6470ce-2023.4.01-19-39-11","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.4.0-unstable.e6470ce-2023.4.01-19-39-11","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"7424ff969128c3a85e6021ba79b88be052c31c20","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.4.0-unstable.e6470ce-2023.4.01-19-39-11.tgz","fileCount":30,"integrity":"sha512-7XGTmptGUq/xxPDV51k/vjsCNDkqUDgYE6LKxIrlF4FdQP1UxyhcuznxUxvnCgII5A94U7GxHXTiOUTiAc2K3Q==","signatures":[{"sig":"MEUCIQDtUzJMx3tJ+/Hnlj09Up1YiwBCj4h7uu03YwzNqTXn7AIgD2wce5f4aGILsPiGHVeG2V8LD2yoTb/imwvdyOAui0U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":37888938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkKIhpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpPQ//XgCCZPbE2wbn6uWYsV8U5uMFjcNK/wr/+8zjTqAMkdDbhuAJ\r\nNovtPI8gMSz3Oyff99sXbsBv+hFuZMQPsNR6BWDnNSY3U+t8iDEL829ik71P\r\ncnAV/36LZoo5MB+4kiP9GveH2Uff30APgs7/noIphPn3yjkfTmkxDKXCMWYI\r\n8vszGkXgtzxdflBU1OIN9eZq04R9vpz+oUQPaTtQ4cLJvOBgZZjOXJlog7zm\r\na5XqZ408N1zdpdKI9GxqhuBakC9k/NV14nJSWnEb7r0c4pY6OIhrG6Okhjx+\r\nFas/uKST5zTOFlZwPHL+3z0t74uFE4sujh+uo5lwWHNjhGK/ls1REPhHLeQ3\r\nLurN00ivzYUzlIjtyCHBOhrq3tmnjKrX5E8WybNis9Wils1mFnYY3RQAQ6Eq\r\nCwTwnLvwENhJN6o9QFrVdnm/xIqKfISDdC05ea47p5Lw21LwYefefQCLN8ho\r\nLJnX/sUYkCK5vkXydogBrQR1bdNB+IgWjc9oWOEJRerZqQqY87fQTQlkAyiC\r\noGFxHsu04hZz9a2FTayQYOAmL4cpK9ywJmU4u50puGWpkGSfQwtCNoFzlNIV\r\nAT8pxyTrJjoI+1lZq4NxNOIc//pDFqcKmYSSlXSguwmqcBnS1NPwQYnOnDsY\r\nStve9PklTuC6zNoplYVjxJ0ke6aQ2uvGSEM=\r\n=pnsO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"e6470ce9a2e3dc0aae92364a159f3a1eb51e4f1a","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.26","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.4.0-unstable.e6470ce-2023.4.01-19-39-11_1680377961019_0.3081185340933481","host":"s3://npm-registry-packages"}},"0.4.0-unstable.6006d92-2023.4.05-19-13-42":{"name":"@tbd54566975/web5","version":"0.4.0-unstable.6006d92-2023.4.05-19-13-42","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.4.0-unstable.6006d92-2023.4.05-19-13-42","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"62fa36af0d948a7a4bbb8c00f650b037ddde5797","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.4.0-unstable.6006d92-2023.4.05-19-13-42.tgz","fileCount":31,"integrity":"sha512-eJHCudFeevthmfV9TcLXjwsSN5Mb4pEKFaZw2WrpzD44ncsuhtNiSeMcwKwTW1ReXRCxVq85vRpcMlkF7mq6Yg==","signatures":[{"sig":"MEQCIA+68m1pL0cN/XTgNWFsX3Jtd0lP0Kf4vu5k5ty/z0mQAiAVD1k7wDKjZrm3nj38z3gi15vDZX36gBjatnsrbqFP7Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38000551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLchwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSLA/+I0n+qFJLjzdQPtLew6ZGDP2/eZIv1JeT3/OsOoIYQFHX5pbR\r\ngOs8lqxl8krRusuHngPMp8ynbumDB5t4FWM+B7cAEda4KhYpsXba5QfyECQD\r\nwBYabf08eEBmzucQOwVZFlVpuTS1EYwwvh26jIDjPjLWsGdme+Dn4txW6vt1\r\nN9XK++aZTKX3NyLExeYBlPkLqw5xpkhNGlJ9H+Z9LXZVVxvrl1VyPuq+KArj\r\nYPf/OoeJklGfVSlONCy4MJC6K7W4dxEGEJQaPVyjSMScfvPtYIg0WmaPyzB0\r\nk64KAJRVlsbYFzweAhi5XmDgLgR267rWC7NySiq6jHSBXYwPWJSr935uLJc8\r\nriSwfj+RvQ6QQRFpsKiLhQu6mxJfRzvtaYlQ8u7whg/8TUf7L8ZyLsXQtN69\r\nckJT3ZZXJIHhGEvERoAJ+7tBGB0EpO5EcEsnwrCPIlJ/vlTejnpFjFiv+VIg\r\nSjpZJROcJR8Bqg6+NdJ3CO/Sg+oD+nLIvO1KSvTd/ByO6oLwwFPWdKDBBkSj\r\nvzufvq6RlvMqwNet5H5FvtKoGqJAB7dRUY48jy7urBwpTAze8aO+hyBXXIHK\r\nO9V2KgH8cC4FhmRwEHMaCqXf0YWsWtPtbNgIg9ZXlCsa0AfV8s4n/NPerR39\r\ndoB08Xm2okamRc9YJUGSlM6Bo9cNJZJz5yM=\r\n=uMAx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"6006d92880b534b4333ef3f46e3d23eb975015ab","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.26","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.4.0-unstable.6006d92-2023.4.05-19-13-42_1680722032132_0.8115173408922407","host":"s3://npm-registry-packages"}},"0.4.0-unstable.bb8a252-2023.4.06-03-16-57":{"name":"@tbd54566975/web5","version":"0.4.0-unstable.bb8a252-2023.4.06-03-16-57","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.4.0-unstable.bb8a252-2023.4.06-03-16-57","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"3c1a57b2ccd71e0fb81e33190be7a0cc2a4a6711","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.4.0-unstable.bb8a252-2023.4.06-03-16-57.tgz","fileCount":31,"integrity":"sha512-7KF3TM+y5eVUlaWZvqxGIYpWOGoefnYAQ3ik37KzxacxRc+ElvUw8eV9AvLcxhb24B7Mxhma3Bzf9ajglyWJVQ==","signatures":[{"sig":"MEQCIGkGRb+s40RGtnIxTSCkeQrt3xCB35kgO8hD4o5BZocrAiAcV4mC6AV+FoW5cGoTQS1eN19wPHIO9GFIIPRwV1e3kA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38000551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLjmzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/Qg/+If0+VdQe56cnnckhEm0IFhZCmDPOIy6vfE0p+FFMfUv121ss\r\nnf0c2UULl30YqUriMwnv+jkaXJpTY5wv/H7OwYjMCSCcbJ2SwRxTXKHRBiXp\r\ntl2qlRuit+e6qwgxHlJ5oAezF50nEBATRRePPVnPtbTV03r89AVw9G7MyC42\r\nRCRZXoVbgS2MsCNaCdpGvQ0RJP92e/P/aBa5L2llMYDyzfzkRWMANnznWhZa\r\nF2oyrZcDRYgdOpg38g22xxOHmlN5k9YUBL3LxLqIUNtM5lwU04FaK6nCu62E\r\nuI6hXItKfF077dE3XTXL4K6v1QnKi5QrhKDWwdROllMtJCViF/psHQpK1eu5\r\nJpf0wRJyVnQxi3B85Qrho5nuxVBty7p7mNqOLRLss7E39UlA6pWRaEwmigok\r\ns7u45sUdgSNXLUqJGYMDbS3PDpTbVU7RciZcEzDAMKCgDzbO7nVlzg6nSeQR\r\n06GJpXdFNk46EcSJt76IApC1SltSi+UykL3DxxTiZ2wK1iGpLtzeiQwjpOzQ\r\nlK4MegN0mNodLN6z4Yk3taaH5cPtoFg0uMpywvbWyymTJAFGgRYpYsweTbi7\r\nAu0uidEeqHLrSoLKeahaJhUHbN7IQ/cFoMK7kRUJ+Rr0n1snTvR/qCOBUBa0\r\n3U9UyA0XawF0F9iPGv7ZngauMXQDgLs0qhc=\r\n=W3LU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"bb8a252e780d70ceb1749a83beb93e72a4328685","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.26","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.4.0-unstable.bb8a252-2023.4.06-03-16-57_1680751026710_0.11881149370968624","host":"s3://npm-registry-packages"}},"0.5.0-unstable.0e142f8-2023.4.14-14-47-36":{"name":"@tbd54566975/web5","version":"0.5.0-unstable.0e142f8-2023.4.14-14-47-36","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.5.0-unstable.0e142f8-2023.4.14-14-47-36","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"1d1f42f4b64fb10ae54ff753786e21fbb985b920","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.5.0-unstable.0e142f8-2023.4.14-14-47-36.tgz","fileCount":38,"integrity":"sha512-gm2+1WxqY7OppqmrLdr8h8tmKJ1Y2k3EfDNZBcvG4GlmKcKmcY8XzkkM+mlHFd5CFxzGTDAA/TaR7VAHlSkDsA==","signatures":[{"sig":"MEUCIEV6PPaiRShTBo1mq33zCPwoIjg5sbTnL4wekW4cLb6SAiEAkdoUYdgE7kzPkbiuk28sY9rnXyIcuo8Vl5u0I/cW4ug=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38308246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOWeSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgeBAAl8VSVTw+1an5sJoWoG8zl/vqVEueY42V1WYMt0yukYSVVbLt\r\ncOMnGteSdnfLiTw90n7C7GGgo4qOuFPlvUQ0xRPvofoYMj39uH+bO/DbmxCA\r\nmI6Xr1mN9ZlTBU6rhahOo5VMVJSPlMZPidarfPw6OkoOUDwYOjYyy7PIJw8L\r\nt3iefUKIv8PDMj5IRXhiDRgYYiyLu5HctQDaT1e9vP+WsyHrHL9TBh9XPYUk\r\nrZpMJQ5CWTiUPHUMtNHKsdsy7PBq4J+qBKlxwxz7XamN8ObPqrUjhFRctQb/\r\n+NcJ+rj0UqOtuNHkjbl1BAznn+UKHniqaWaFhWmK4OzR4fj16gtp/N4y2JhS\r\nUoff8Q5SWgZfS9Epecicg0D29wVr38DuNxsw0S25B1r1NISeEwPQ7gyN0eST\r\n/0wZlXHJmeWgNYiyXF71UBUufnrneQ063eHlM4K1YOSqA0ultg9dYZac0Btw\r\nIiUpegYbIhHTOkicZFrOM6QSGAMPYlZJT0LMrPRwb0JxpO3+2akI1xvR/rfM\r\nLwUIlSJvDPhmp38HV1RKQtXD+l36JiqzERd1czGvCpdedDt/uZjSDTK1zQAV\r\n4ekpQS4SuQllEJ0TZPUK/EyNF5jpWLIeCtFtjTmORmTfEHil7rfoOqWCdZbE\r\nrPUTwljALY5VE20YfC6+O4EUXryu9xJ0Jbk=\r\n=P4rp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"0e142f8a9c25314f5e21b96247f74cf9bf44ac8f","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.26","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"^7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.5.0-unstable.0e142f8-2023.4.14-14-47-36_1681483666339_0.5439155920931193","host":"s3://npm-registry-packages"}},"0.5.0-unstable.786f182-2023.4.14-19-49-40":{"name":"@tbd54566975/web5","version":"0.5.0-unstable.786f182-2023.4.14-19-49-40","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.5.0-unstable.786f182-2023.4.14-19-49-40","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"9941ea1be32ad454356b34f29ab8f00b2d9e697b","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.5.0-unstable.786f182-2023.4.14-19-49-40.tgz","fileCount":38,"integrity":"sha512-cWOBgW18335c8bL1zbdyAwxeuRLrdd2t/MPPS4tkwpXlfonmDFRWyTVDwSPiLm2sx93tcC0eo3PTkSHEipuV7w==","signatures":[{"sig":"MEQCIG4hCGWgfL5x6urX6GomKzRbmFBIB4mqNb23gvP5G05/AiBKCnYZ0qHvVmUl7rL5Mi7MGRJgx5svg2klHm+UI3p7xg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38320433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOa5eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8Jg/9ETR4DgzfyqZDTU3Vxy1w5qFWyB4b/RE7lR7jrPWVtTAb1Rd8\r\nsXlTZ2Z0lezuRdsLrdI/gJZk0Jd5ADwT9N+y0GhjMlWpY3mon+rxCxjx8tAc\r\noe+XjSyraBf0LTH0OiFcDXjA2JJLBZ9PZAhLT957s0p+Iz/7F8/AuHPrZKH+\r\ncl7AlR2O/+EoEKgDhNEjB1T6mex/CbckjH8NVNAzLse7LFIG9D/8x21FSfc6\r\n+yWwUYr1MPIug28X7HqQYoGrU4BJo3NFRhNT5C6k1hy/fOyDD2sephahVwWL\r\nUoMx4D9Vj+Jdsj66J9EanI6VIzghUb1DuPFv1xoj7DowOCg7vxtXbQ1QAdPT\r\nhId3h8rMYJChmsi4Z6FC/PKmxksKeLaoatNQVjM1AhhIbk8HCTr2QO9LGaAy\r\nxhaJ5RUWnZT4CbEJ2LxIPygwoBe0acNQVqnKVwgaR5sd8hoe5kwQyK+A1za1\r\n9KARXrn606PSz04jiDqXXnSCxhVQ4PekzgLhQptlAOXHy7Z1RMzfN0FA9lvV\r\nAJt/tS5y8oRYxlzTi3RHwwaFLbXBnbaaEHcgQiFwzHWk/vQnEeghDmuoulsS\r\nnB9XQSdrV6kLx51S/9Yeu0kazij61U+T+TyNW7zvBqbXPng2xEhgxxN8BREJ\r\nakxCcSbAW6WKMpVMJHuLBJipcILzZAMVabc=\r\n=y24u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"786f1820986a30a81376a34d7013dfdd3e6c15c4","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.26","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"^7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.5.0-unstable.786f182-2023.4.14-19-49-40_1681501790283_0.8788244371024378","host":"s3://npm-registry-packages"}},"0.4.0":{"name":"@tbd54566975/web5","version":"0.4.0","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.4.0","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"11c8272f2931f7d2346c6ac2eb0111b13db8fa59","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.4.0.tgz","fileCount":31,"integrity":"sha512-PPv5Gh9/jJZNVHKg8OnRf4+o5WTS1U2SoIS9HknqvBsxJ/ilnoKfh0QdykYo7gqDDonR7nqgVxDQhJeSQOkRIQ==","signatures":[{"sig":"MEQCIFx40nXwC+kDW5+csx2ASHfsAOAyK8DbJ2s3Xqg3j4gxAiAay8z9CMFarlEed5CPJHpiOjUz2xxPdvRJ4tOIfLSc4A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38000514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOb1xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKrQ//bN6ihPfyOPkxfjCyG8H5YMYRAtdCkpvxGl4uvqdUZ4/46lpD\r\nVApSWei/hixDkP05HHzx2zXDQhZrCB7swUPbBccey2emRgTVQoVpLeEipQrP\r\nwEmQ2rTF77SG3D/oa0L4Zcl9ITvgqxWhyoUrnL+ILEhx2Xym4UWovJbuoziE\r\neUMOip8z0QpgnyAyvw3YYbruQYJbmpoV62kH1IvUEcUVgSwLl2mzVTPh4BvG\r\n1aYjj/xwFEOn+vGC35tus0WH2JfaGUaazIJFJ2HhQeR3fZmH4QMJZY09d1Jg\r\nZGd6Qvx00zp9uX6KhFmICqYqRaPASd1sTGqLdL7GfAD5TqN3sXjXernI1wuG\r\n2xxywD/ZQ9oPfNrmhx8aPulf4zxIa0UFARVVdSxkeXK1yzCLohaVdia/22KQ\r\nrUN0GswlmQxY4LI0sGpcEEOr8xtXbjAh9TTxLdUda1ddQ8FurENGp8/YBu9X\r\noVyjRyDsOkLxrukWyxiCNGaEtF/CpD2fLWPHniZPVeWffjbt6lAtWHOwdzVQ\r\nmBDr00HyFYbD6P4nz/ShbJIVHrkcQzhpuO3PjKQ4kjyeA1rolM1at5plpjGw\r\ncARnzRL3gOYpmWHjC6pG5TsKE8jxHpZGFljkkkSSSDrQo2YDvoCngCUQpQqz\r\njmiz6yFky4Id7uSOXjv9jDly5gMzcOtJX1g=\r\n=Gd6g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.js","type":"module","module":"./dist/esm/index","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"bb8a252e780d70ceb1749a83beb93e72a4328685","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"mistermoe","email":"m.jangda88@gmail.com"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.19.3","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"19.2.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.26","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.4.0_1681505649179_0.5456078646220819","host":"s3://npm-registry-packages"}},"0.5.0-unstable.a7b0e83-2023.4.15-00-29-09":{"name":"@tbd54566975/web5","version":"0.5.0-unstable.a7b0e83-2023.4.15-00-29-09","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.5.0-unstable.a7b0e83-2023.4.15-00-29-09","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"979949f92f13e0c09fa027dd0583dfa8cedf770d","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.5.0-unstable.a7b0e83-2023.4.15-00-29-09.tgz","fileCount":38,"integrity":"sha512-QJzffKcIxU6czdFBtGRiERSfX79SxGQB+GwjmwVvlV/T7GG+k19GDCqoUiK5Aq0rh2KxxH2njmIUuZC2w72C/g==","signatures":[{"sig":"MEYCIQCPbm02/0NbBlHPqLgN86Vt8Wt5rRNXOcK32trwpEH2EwIhAJVhSgFm9G1aevkl/cl9UTgFcWErsnSf2ZTadPs2BlMx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38320438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOe/fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqrZQ/7Bjp9y7WwOkr6OTzerOuqZb2oeNRNgpr+iKQ66H/0BEUdqspj\r\nfcIsKy3pglfUO5GNB8MKaHf2/lx/YiNGL2N6l6iRG3TuTjJYkJ7m2RGgHKmp\r\nBDMiCrS6aRqkpRLj5z2UUwpm1QglLEm+6dpunplFbUqtnk5BwR/jD5PB6vxZ\r\nrCAuQfJRY+0q73BW6y66J6AWz2rT5YTYB/i1RuVtfmLRNj2BklCnTtOfRlYZ\r\nE/WGguV9kUNPfCxy+51WmqbsMaQ8fi4kDQURNZtzAwnKn6H7WLo1FlYHOrow\r\niIJcdtRSoVUOn++s44hY2Z/5tWhXAsZpzChRNuC40Bn3vD3Zh1OrlVpqaK60\r\nFkeNnckziANJjzhiX8+Sviapi+Dl3ZnbqywIe1g7RxP6bSCcd+4+7sjg7QcO\r\nJB+utPcnmP9c08QP/2eFTcRMx0iHE4FUtK7Pti/eMPTQWvO9J6ivltZhOThS\r\nmp8rAKeB5YZZREGKTQ2y9TMyo2wklUOyjZAdNkLHoDXOScdXzkyR4EZEgKm7\r\nZ4Oc4TU6k+bLMT84WeGc/EXO52MP83IfUg0vVPKUZimv+o7t2Rj/11blQwA9\r\nsgvfSsVCVWZNEOBiVvkHzAYLrK21ndZulmeaUGr/83UoMAWtbrUDEU9EGGer\r\ng1xPfPgcC5Hu6bf/qnVxoefsdYKg7V8uueI=\r\n=wtDd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"a7b0e8319530e53ff13eb41088fba410453086ac","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.26","@decentralized-identity/ion-tools":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"^7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.5.0-unstable.a7b0e83-2023.4.15-00-29-09_1681518559355_0.2705090877166034","host":"s3://npm-registry-packages"}},"0.6.0-unstable.3e81ed1-2023.4.21-15-46-46":{"name":"@tbd54566975/web5","version":"0.6.0-unstable.3e81ed1-2023.4.21-15-46-46","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.0-unstable.3e81ed1-2023.4.21-15-46-46","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"41e898b1b530c7ce2603510f646fbb233f59f337","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.0-unstable.3e81ed1-2023.4.21-15-46-46.tgz","fileCount":42,"integrity":"sha512-16WFczmmsPU+LSWOuE3y1mlgo1eLcHS7wIvWsUOFymR7dztLqDR5KTgTSnUfCdVrK/TeV+R8r2QJnPCK2btP8w==","signatures":[{"sig":"MEYCIQC63NYnY12Gnahtv/cFZwxFZXrhn+L3biWTTYapsEBpHAIhAOxKsrwgIKh+zm7H0OMsvP9ePcczpf+Q4w1VXr9+4iSi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39651238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQq/xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNCQ/+M/wr8N9KISTJQku3psnAm9boq/zpfp+hmrYl5Dtk2OChxIij\r\ngFc8A4NIgX1pCWai7VFSCnBgt8QOUCTAzNqq+wzcbOqqLe4Vg7KHQ2DtqwMW\r\nyeaT78wsMsnU3I6Jn37T1HiaRnzNB8TTJGYY8J9wLT0yXHb4JzA3KjSd3VIv\r\nG4XzHnTn3dOZEwdTlGK/0zrme1pSAzfS3/beoWvLC/yuUTKXLb9jpsC9Ek7G\r\nQZcr3KwECdn8M0Wf89M3D9H0mLchQcl44vyT6GozHjAVA45rCMdNEFYA/the\r\neW3OqV7bpaqUfQtb6RbEvME3B6ZDTqt5KQDeia2gibzkvP0dOF2sSq3OVznQ\r\nrPhbfABLQRtihWns36FyPvccXdTRjq1a37MWciCltu4wAH5rNud94FoDLqyk\r\nc0XtBix4DVcHo0Mi+6/LiItoB7RmSi3xVW8yy+/e+O7e/3giAenG+oMK/D2J\r\nIvbd+/XWio9QQFaYJfdJZEi8Ozy5Ozz1KTb3TOMSLncvlgGmzpa3myW6iBsm\r\noNQFWpAfrC2/TDjcrxektHaNZCHopPH2bQHwZIsXBXRBkqR1DH8/vRpf2I61\r\n5Kh1IqRWjPKLWzNLROYvrajXsQl5xmxqjDVta8NF/uLjXwc7Hygbvd10Yyum\r\nrxGuGE+FoHSPdkydn9MnB9cFRN4NChaNUCo=\r\n=aA1+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"3e81ed16ba37133b1c66e59a1374b7d161fa5538","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.0-unstable.3e81ed1-2023.4.21-15-46-46_1682092016808_0.77581550544643","host":"s3://npm-registry-packages"}},"0.6.0":{"name":"@tbd54566975/web5","version":"0.6.0","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.0","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"53b1b6b5382d09692820663dae3ce00eee74af65","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.0.tgz","fileCount":42,"integrity":"sha512-EaLbAPCwkP7Cfom4SAseveUnAAoEcZ138/04/GH0nRn02AMsoFmWeQhYN4Ei5KWZTsH7qSdQ4t9HNQV3vEvsqQ==","signatures":[{"sig":"MEQCID36rAp6471YfMI5x4EmfUcRBe/5VpcQdihCIPvWVPXrAiBzDBTHfGd8V8IsxfeJGOA7EfqNBxS+uzFoY+CWqjLbhQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39651202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQrGfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqG9w//U24X+gMmryNJKOBHhC1HU309s7Ohipcinkoh3Xu3+SC4K2ec\r\nywXhKFOBcNFZSjthq0M3SAytl001N20c/Dp7IkXgUWOToBJSBw+Hr0AFVh4q\r\n2YIKxWyrBaZYp+HkwpN6619yBDnIdoChfMO5rG/zOnb1OV07LsF2BpHMLF4N\r\nH72GVUx+0RC3Vv1MNVmbnJzmzZmbjvmAxX92e5GnOPYekVJ3r/wcf978RD+T\r\nsmiR5Yw99RFr7yLjJm85YG8VExGetb7XH9y2wntNPoGdZwgrumGu0ZSjwBG4\r\nER9R66E3nHBEhyECeZIO52sWfN85PCyWR1yrhnMj6LsMYAH1NJkM9CxpRuZA\r\nOoDNq1cVQVYQdEhpSOXNChjgcA/2lwTn6aq1iOMtgqyjWiK+1GPm037ofUe5\r\nynQJJ3RLYQB2OZj/myt5YOUH05Cr1xld9CKmG4T0GN9ZhsdV3s4JLFis9Q2o\r\nsAqCWdcn5+18SdJHOr5qicnpJA8wx9ixSsq5oci2l8k5eJ6bFibLIuH9Gw9a\r\n9DGqkbBdP+qcP3ASwJWO1KsFQoddWTXtrBbqJ0dXuZ04UvqcgTo6yvlxdbM8\r\nnEjVKGUs7MRf3cwwsd/fUybhBAHzhY+GNEmSKz6T9YbVXWc/FNNQDm7y0aBZ\r\nbWs+XI94cIfaL/2tJBorR/Ci9cIzdnd/aXk=\r\n=nNJb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"3e81ed16ba37133b1c66e59a1374b7d161fa5538","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.0_1682092447484_0.7408972515744328","host":"s3://npm-registry-packages"}},"0.6.0-unstable.ee0107c-2023.4.23-12-44-57":{"name":"@tbd54566975/web5","version":"0.6.0-unstable.ee0107c-2023.4.23-12-44-57","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.0-unstable.ee0107c-2023.4.23-12-44-57","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"863c3bb1ceb3a2acaf9ce4b4cd74438d357dc3c6","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.0-unstable.ee0107c-2023.4.23-12-44-57.tgz","fileCount":42,"integrity":"sha512-m14c7XqyTHDiRLPzyFexLOG4WniS384pqHGWuxiOGX1pvajuFM0VAzbhIB3UqcBlw/cE60tHj4SrDNB3Zqh2kQ==","signatures":[{"sig":"MEUCIQCM8bHRi2AMD6/9Rbmc7WYCJozMgrYAQ7FEKZlAB2EPIAIgBpZgmUfEX5Jp7VkG9iOOy/aYnSLOeDOYgLtWTBJ5Pyw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39673305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkRShSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/dQ//WN1Z4kIt22fPfNQvuFDUXYVGM6PoOnZuneIvcc+A5k0ktyHO\r\nk2/VpWZp6QSQHP9PZmhYvGcWUNBuAbV5+klreGuFt4MG2N1BZMSz5zspzsHw\r\nverd13AVQU4czE0zV01k8FSanL630baAYfctIZ0RliloID993YCVWy11XpNu\r\nzMlIECieW+4HnVqYKyltZyOUb+QhJN2fC8vtXkMNXi9Tqk+d9lx4OeHX6dwr\r\nTtIQuhoKYkumB056bhHngInErXWNCOHi0G5CKYJwqllxNygtSsNREqNKuvHQ\r\np+FAFBzw27cD2WX+cSbt9XSHT3vLD3yyCiSI8T1JdIQKrRY3wiyHONZGLvPp\r\nF4qnLg6NLZBZF5Tv4zevmvQAHRU645cQAEDoLtPUzC5emjzDuyaR6xOVGs7C\r\nio0CHATBmiV9vqAbzN1l7Kyabu/urKNZYss62yThaMsr7xOpBHhmMpWxkvEc\r\nJ1opsFfNnTYZvinmIvtS2HpFEFEjlZHUlRqeFD2c/QCd8OGfEPnSlB4PBbNM\r\n7t2btEtI/y6x8x9fpg7Yy/tYRAg3YjLvgtBHApYfXEjGLMdJY5OodIgMkr+0\r\nyzRbLjhfdvREb1Ln695F0X8sMujT5JO1+6tGUGJsORcIFqMBpP/OUKG21F45\r\naIpVz2JHURXbO7zMwvssg2L8pt9OMjFjfcc=\r\n=F0UM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n[API Reference](https://tbd54566975.github.io/web5-js/)\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"ee0107c7b32b9685a6665af753226b5591d83f24","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.0-unstable.ee0107c-2023.4.23-12-44-57_1682253906113_0.903580960551877","host":"s3://npm-registry-packages"}},"0.6.0-unstable.0e368cf-2023.4.25-18-15-55":{"name":"@tbd54566975/web5","version":"0.6.0-unstable.0e368cf-2023.4.25-18-15-55","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.0-unstable.0e368cf-2023.4.25-18-15-55","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"4286e18dd8bc94b83f32b60666eddffce245af70","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.0-unstable.0e368cf-2023.4.25-18-15-55.tgz","fileCount":42,"integrity":"sha512-oaYyMUuWGAUN1hOqED9cKv/3iDPydVzAvO+Eaf+cW6P/W3ueVw8+wJ/k0ArO1xhABMEKvV6kU4JVJp55Kfs9bA==","signatures":[{"sig":"MEQCIGmYqHTcw3iHxbCzgJpplun4/Pn+/FL8v5m00xpLX/ZqAiBcX+XAmuu2UzFL4YgAY9fzS4CQUJlAkUtnBjm2jO7A9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39673305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSBjlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolARAAkgVL7NXGPf1sOtTCVWgfF1nGA0+2JoXJPWFDCmwxpZffs32g\r\nAJwDIA8ZW6mb4EO17zRBisPs+eXp4H+e1sZKFoWKMUyKgYZGB/QPCj+4xQ4i\r\nvMx6jmMXDceWeD7rHThls3qFOqVtMWgx2TSVulCoWs1Y+MHUHgJ7Ish50vay\r\nYWH91DnCHD4lNtF8k7h/xRaYRWsHVBDHiJjMRjqzqp1zcLtuUzlcCnXYg/EN\r\nhWv6GmI64RwE9vLM02UdSZfM8DNxZuKkbUHZKqH2yoZ98da4rtqqk7lak2nc\r\nhD8kcQ0teF+RH3YuKkf08BWx/Wv3nTzuFdVYRULw1jP1/E55I8PJwdoemYiG\r\nzR7/cHFNR7dMTo89wKSWvuOyeCrQCJYxEIs5dWzqt+mYkWFL853ADNEzxDth\r\n6LHCpQMcPIKKOjEIraIsaXYMd6aLY2rtVXgtlTw1RFktJ7XeCN/EkiQf5pRf\r\nKW+x+pOuaVoXUC2tqQuXNqpx8jUKPlGyfnD0G3YhxXckXVFcZcbK+MxnG733\r\nyAn3YLhka3E7Fw4BgohfYVvVb/2wodoM+kZW1D2OTakzPpypFterDP3TJ58e\r\nJimrl5oPWhkBZJPnudYkpLxPuaTG3pJz8as2ksZlJCvJBw/A/1zzz1tiM4Oo\r\ncFOgBbmQW/gLT0er+FASyfv3LRT77/MyOlk=\r\n=F+kx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n[API Reference](https://tbd54566975.github.io/web5-js/)\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"0e368cf564702a79deeb2abcbcc403a044325ffe","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.0-unstable.0e368cf-2023.4.25-18-15-55_1682446565027_0.36057819929901225","host":"s3://npm-registry-packages"}},"0.6.0-unstable.d5caeaf-2023.4.25-18-18-08":{"name":"@tbd54566975/web5","version":"0.6.0-unstable.d5caeaf-2023.4.25-18-18-08","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.0-unstable.d5caeaf-2023.4.25-18-18-08","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"a6bb92f131bf8f60c21466d5cc7138fcd9c31246","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.0-unstable.d5caeaf-2023.4.25-18-18-08.tgz","fileCount":42,"integrity":"sha512-2TjEBwjt9U8xGF4+YSae7Em7eANaA6LVX/wqFC83KPrd98JhLOfig70U2RTZOL73zvYaSvN2qWUGfO4DxAUFtQ==","signatures":[{"sig":"MEYCIQDMij4lnqJN72tojzzx5j0VqjqrwPuVWPZFJfmldfj5EAIhAKIE2yuF6hD2N5E2im9UsTA/b6+4TDwmbNcShF03ydYI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39673305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSBlsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmroIw//fLbdtd4/fakA1qby+pj8QJTCqww1L8JyiOWAG0NVSuH9iXso\r\n06oMga9oy5yuWSYnjcLMEJg9cYaVIAWMesd7Lg2/b8X2bn0i8hEl/ZkPJn0X\r\n6MAn8AlpoivNOeCs2Nl3Vx/kTKJ1fX+OvnzEmQ0I5HwAJxizIb1V33rA8lbC\r\nsBNkMf5LkH6hnHVJsMtIMbZwaPfWOOlhN/S/1w1IpXpeVhJI9fIS7Bmoa5Nf\r\nD/oUQRv20SO1sfg16o/j60zr/O7Qb2S5NGL/oEpB3hg7y8Q0YyyVWqY8M8mJ\r\ndEINJPJn+bDcn9x+cKDgR7qyS5Jukhg5UZrzAU6M72jUptbg4nqmYmOJGGp1\r\n2zuJJDeriLQDxn/Lq6+6BaOuYAyvG1revYFeN10A0ONRoAr/Ib/WHoVJBKeP\r\nfugkBR8Uhil6hik9CzaiNEtuT48Svf/05eZipVVuQECLX+OKftLR2kGgvPO6\r\n0n5gcVEVgV+xaOexBzF70yuqrxfnN/VYqGhrKdrouXg6fjmFg9W/rw1RZIrO\r\n28klRRSBw+XpVJZUnM72d2c6haxP1kzTwtFZ8jOvXNoNB5smYYm73o/EKPy6\r\nfCADpNtrxpaOsrWT2eIYKnHLjWQQ9wxRJznsrKwULZEuwaHu/IHaV4HZJDRc\r\nvu0CEDHtGdObbVEPFDNOAR820AFi28SQgpQ=\r\n=ZVOu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n[API Reference](https://tbd54566975.github.io/web5-js/)\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"d5caeafd7bca6ece6ebc432b05d254708d7b2f00","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\"","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.0-unstable.d5caeaf-2023.4.25-18-18-08_1682446699968_0.7516782123864056","host":"s3://npm-registry-packages"}},"0.6.1-unstable.8300edf-2023.4.29-13-08-15":{"name":"@tbd54566975/web5","version":"0.6.1-unstable.8300edf-2023.4.29-13-08-15","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.1-unstable.8300edf-2023.4.29-13-08-15","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"2992e96b6f56e94bde523bdb96ca8e9c22ad36d5","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.1-unstable.8300edf-2023.4.29-13-08-15.tgz","fileCount":42,"integrity":"sha512-aW4DrUaIZ9tj8zylE5oPm0S83toZaAiFrOjET+MrSPMvkgUMaEQJZOcrhXIm/z02taPaOt8JcCKmaF+i/LWUBg==","signatures":[{"sig":"MEUCIQCZekNKD2QEyE16ujdFyIqxu1n11dtoFtf0/SA2xAYVQwIgCSla/N01s3ElWe5iD3gx4bwdsbeIu7zH7CeWB22yaUg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39673215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTRbJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYag//bSWTJdY5RpSKQ4aUze0TnnFIOs0lk6zA30PzHbddGo1m07eC\r\nYXU7m/62zfsZqk5RkXkGkgUe6wrG16j0rDinxC8AmZbPQdqF+wNbiNIx5swX\r\nntHpDvLtKfVlBiG1OfZj1rSOOWj5/K3w2D63bhKeM1bwKqkwsdBQEn285gb1\r\nWLAjQXV/VcxyKrecGSr1/paqHn6/t8G+1Dn0tOGTI2unRyM0sek5Wu0H6flM\r\nYG9LD2c4x8IprowKuJDjtZze6af6U0J0S8qBTy7DMGg6F8cf6UcYmNvNbMf+\r\nxf2AXZ4XOxc2lpTMOKr7pIwu+fdQS8SdpwlraV6mGl8avpjz5WJsgkhj+K/s\r\njTejM7l0n/R8wEDx3ilXZFzbqIqtgDmVMoyD3dD6T8MJdsQ9ZIKLUbzUCkYS\r\ngIUSnaQiTQgNlLKa5DVRuzqqYbuBeLPacAJSRU4v5bE9gU/qz4PxIU3MMiQS\r\nzso4Kx0ZhrzNn6jBYqVl7mnno84H/r7hG0Ivg8iYkmQ8pWoY6xs0ObdECwKW\r\nzGSKNoE9CX/t2CcO+jWCGTMc2pzwwn6mVRK7g0qisVQaNEssZvb/baQcE+UE\r\n/QjRT5gVl3xoorrA0ayZip9UTwuM5SBqNZFEQAcd3YRGvc8t22zVHta1v2wu\r\ndFrj8qJxSN0M17iXjp8AsdvYDT+EoaLL9f4=\r\n=YSaW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n[API Reference](https://tbd54566975.github.io/web5-js/)\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n```\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst imageFile = document.querySelector('#file_input').files[0];\n\nconst web5 = new Web5();\nconst response = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: imageFile,\n  message: {\n    dataFormat: 'image/png'\n  }\n});\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe confiuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {\n          \"records\": {\n            \"track\": {}\n          }\n        },\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"8300edfa5b53b65415f54743317582584d417cfe","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.1-unstable.8300edf-2023.4.29-13-08-15_1682773705291_0.5472350484378368","host":"s3://npm-registry-packages"}},"0.6.1-unstable.f3867c0-2023.4.29-21-05-26":{"name":"@tbd54566975/web5","version":"0.6.1-unstable.f3867c0-2023.4.29-21-05-26","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.1-unstable.f3867c0-2023.4.29-21-05-26","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"37bb7cb9b847daa303862394203c41c5a1949cc3","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.1-unstable.f3867c0-2023.4.29-21-05-26.tgz","fileCount":42,"integrity":"sha512-f3BgMcpbx6N0YVbk900tHG3flupU5F17PQ55kx6hU/lRzL2Bw0VRuVLF33hVM7510BaM8skoelc6YdgWlpqYmQ==","signatures":[{"sig":"MEUCIQCeb9gMFCSOmm/aylsUCK8vbhowQEF8qkC2q2amdCNCTAIgTtQlsEsdhTRCZhmFrUNMj8rlVSkV1TVDZS7nRk1+79Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39676524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTYahACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpcHg//crS5RL7forwN2QSMVknzL76kFwErpakAh1iJ3UpHu/JxeQgg\r\nnW3q7k9BC2MFz+kb5tzpFVNKY9A36duK9A4VbjnBAmn8pBTD78shIIAarBgA\r\nmrFaQ54F/ALzj1yHfWwMxxcrTqRljTlykyPHYUmKPBAi5y7Wt4Tg/ejLmkg5\r\nJA5X2Jf0nb0Zi12BEkuYEJVpCUw8plFk/hi3+L2n2ftPykTKah6lHVXxu2mH\r\n7anKKCRem5r8VLmJVX3EYm/DY2LLf2r3JmxFSl3HPdo2DRlq3g7HRjSCaSOb\r\n2h6HFKedDKDZPXUHd5Lb52y8zm5r0acWrlqufyejf3FYxt93BMli9DzT+nQ+\r\nTu/tfRido7uJ+Fq7L622jb4H5VJor/jKZJAQ6i1vMIl3W6mGMv86i077YE4J\r\nj1zCutARz1IMDQz2NzbyvdtFst8CBA3vdatfqF4n0fLfFSHXW51TSW83H6ko\r\nJbJp0ldidsMtfrlghkxMIIzFrf5yTXiJq1W1DKsMtgsauHlFevP5W2d0AYLe\r\nq+im1b5PBcrDELr09RjTB0pOn2F8Tk/V4PMTltYaf7KrY2/rd0Hnae+3F8LJ\r\nc8UKeegRpjexhIhrimHsxisUxFgh07wx54powNOJ4N+CWnDgKD02D4aA4kmT\r\nO93P3Wdex45R0ciCluGixvh6jjJFTGQsuic=\r\n=XwLP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n[API Reference](https://tbd54566975.github.io/web5-js/)\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` scope enables generation of DIDs for a supported set of DID Methods. The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to decentralized DID networks.\n\n#### **Example**\n\n```javascript\nconst myDid = await web5.did.create('ion');\n```\n\n### **`web5.did.manager.set(did, parameters)`**\n\nThe package provides a DID manager mechanism that handles interactions with a DID that is being 'managed' by the local code (be it in a web page, agent app, or elsewhere). By adding a DID to the manager, the library ensures that all interactions with that DID, including things like signing and encryption, are handled automatically.\n\n#### **Example**\n\nAssuming the `myDid` instance is present from the example above, you would pass the following values to add it to the DID manager:\n\n```javascript\nawait web5.did.manager.set(myDid.id, {\n    connected: true,\n    endpoint: 'app://dwn', //this points to the user's local DWN\n    keys: {\n        '#dwn': {\n          keyPair: myDid.keys.find(key => key.id === 'dwn').keyPair,\n        }\n    }\n});\n```\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n\nconsole.log(response.entries) // logs array of Record class instances\n```\n\n### **`web5.dwn.records.create(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst { record } = await web5.dwn.records.create('did:example:alice', {\n  author: 'did:example:alice',\n  data: 'Hello World!',\n  message: {\n    dataFormat: 'text/plain'\n  }\n});\n\nconsole.log(record.data.text()) // logs \"Hello World!\" in console\n```\n\n### **`Record` response instances**\n\nEvery modifying method (`create`, `write`, etc.) and query entries return an instance of `Record` class, which is a representation of the Record(s) involved. `Record` class instances have the following properties:\n\n- **`recordId`**  - *`string`*: The unique identifier based on the record entry's composition. Note: all entries across all records are deterministically unique.\n- **`descriptor`**  - *`object`*: The descriptor object for the constructed DWeb Node message.\n- **`data`**  - *`object`*: a object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`**  - *`function`*: produces a textual representation of the data.\n  - **`json`**  - *`function`*: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`**  - *`function`*: returns the raw stream of bytes for the data.\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\nFor this example we assume we have created the record and are using the output `Record` instance from above to overwrite the data of the record with a subsequent `write`:\n\n```javascript\nconst web5 = new Web5();\nconst { record } = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: 'Hello again!',\n  message: {\n    recordId: record.recordId,\n    dataFormat: 'text/plain'\n  }\n});\n\nconsole.log(record.data.text()) // prints \"Hello again!\" in console\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe configuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/audio\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {},\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"f3867c00507ea3b3841c87c199ba1c75ad9d02d7","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.1-unstable.f3867c0-2023.4.29-21-05-26_1682802337645_0.16782186881376693","host":"s3://npm-registry-packages"}},"0.6.2-unstable.13e31e1-2023.4.29-21-13-29":{"name":"@tbd54566975/web5","version":"0.6.2-unstable.13e31e1-2023.4.29-21-13-29","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.2-unstable.13e31e1-2023.4.29-21-13-29","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"0bb8c1a6a03bca66620589c8c98b6fda773242c5","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.2-unstable.13e31e1-2023.4.29-21-13-29.tgz","fileCount":42,"integrity":"sha512-1FCbgxoOEaV64ZK9HJxt/e/ZnDmHodPQSF6ThSgNRUSv/x0hO0KbXlGvsiSWKTTXJbFhp29NFtENEgLaPGrGWg==","signatures":[{"sig":"MEUCIQC6kfBhB+4xpwUP+ZTV4Mqaycf1EpuBj1l+uK/eOb/4DgIge8Ge4PL8zUsOZxqQMzlAW0h7eeVmiBGy9NvlDrM/0Q8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39676524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTYiDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXFg/+Ne29/j982RibWwqRFtwu4utZ8y6XO0S6Dgx5Bkn8Dfu33Yfm\r\n6mTCmNALfFYwztS6wryrQvwyjH8o6I3ZklwtJmZWhThwsuds2qqYAfD7srdE\r\nJr47Cxw2uF0dRV7PThs9skxj6QEV15YZjMTlsBkEEfV19GujzFNHm9yXMhQO\r\nYhKlxb0QZ9IOQRccw/SgGlwbwOajBVHaCtQN76F8Fd8UWuknMJAmhxiR4P+7\r\nKzbKWSSHN62D1l7SOIzzg6YsHjiUPkau00qpboaS41ONRMkVLLkH7Bqns82Y\r\n1VJKTBYrn5iEZZpZ4eOfVrCoeXO2XNKTcSMdlipGYKTVpuqbOjOv1oskZEsi\r\n+5J/45v+1w82PgHA9Voais1WTwY85z6xtNjp+0XgLfrvH4hHx5adIEV/Fd3J\r\nhWNGHqyk/uMNQSC7nI09AFojFIaKfTSSFcQN/T9KVGWK4qai5wy8/ymAybCL\r\nCIhLe4wlC1rqenyKMazrErTmWahWHlyEh9CysygLKCiteQQTycbO4SCPVXsT\r\n6UP1XLEFuBW8HDT6FRHh01axwV3sGgBgAZWuRo7RUQ5PqQbICeCsi2oRgcNt\r\nHVhynyT+hLT9ENtl3/R/xRcxS8aMqazdF94SHNASEpvTPVlcgehjxJHlxuPa\r\niwfrh2dxESpV8gwJ6mceRPnlZT5HwCkM2ms=\r\n=+ptC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n[API Reference](https://tbd54566975.github.io/web5-js/)\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` scope enables generation of DIDs for a supported set of DID Methods. The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to decentralized DID networks.\n\n#### **Example**\n\n```javascript\nconst myDid = await web5.did.create('ion');\n```\n\n### **`web5.did.manager.set(did, parameters)`**\n\nThe package provides a DID manager mechanism that handles interactions with a DID that is being 'managed' by the local code (be it in a web page, agent app, or elsewhere). By adding a DID to the manager, the library ensures that all interactions with that DID, including things like signing and encryption, are handled automatically.\n\n#### **Example**\n\nAssuming the `myDid` instance is present from the example above, you would pass the following values to add it to the DID manager:\n\n```javascript\nawait web5.did.manager.set(myDid.id, {\n    connected: true,\n    endpoint: 'app://dwn', //this points to the user's local DWN\n    keys: {\n        '#dwn': {\n          keyPair: myDid.keys.find(key => key.id === 'dwn').keyPair,\n        }\n    }\n});\n```\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n\nconsole.log(response.entries) // logs array of Record class instances\n```\n\n### **`web5.dwn.records.create(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst { record } = await web5.dwn.records.create('did:example:alice', {\n  author: 'did:example:alice',\n  data: 'Hello World!',\n  message: {\n    dataFormat: 'text/plain'\n  }\n});\n\nconsole.log(record.data.text()) // logs \"Hello World!\" in console\n```\n\n### **`Record` response instances**\n\nEvery modifying method (`create`, `write`, etc.) and query entries return an instance of `Record` class, which is a representation of the Record(s) involved. `Record` class instances have the following properties:\n\n- **`recordId`**  - *`string`*: The unique identifier based on the record entry's composition. Note: all entries across all records are deterministically unique.\n- **`descriptor`**  - *`object`*: The descriptor object for the constructed DWeb Node message.\n- **`data`**  - *`object`*: a object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`**  - *`function`*: produces a textual representation of the data.\n  - **`json`**  - *`function`*: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`**  - *`function`*: returns the raw stream of bytes for the data.\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\nFor this example we assume we have created the record and are using the output `Record` instance from above to overwrite the data of the record with a subsequent `write`:\n\n```javascript\nconst web5 = new Web5();\nconst { record } = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: 'Hello again!',\n  message: {\n    recordId: record.recordId,\n    dataFormat: 'text/plain'\n  }\n});\n\nconsole.log(record.data.text()) // prints \"Hello again!\" in console\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe configuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/audio\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {},\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"13e31e1649b8c0c2737cc9e09ffa747e92db3455","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.2-unstable.13e31e1-2023.4.29-21-13-29_1682802818800_0.37217838816363447","host":"s3://npm-registry-packages"}},"0.6.2":{"name":"@tbd54566975/web5","version":"0.6.2","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.2","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"abf1fb4ef64da0bd70cdcd00e66a43d456be751a","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.2.tgz","fileCount":42,"integrity":"sha512-yvefNNRFsse5j7Cr/RqRGUwkqnhCAO70ckihbUx+afFBsRg2iHdlj2teTEEiG4JhVTZuQdSI4+m4SYQ9lHbadQ==","signatures":[{"sig":"MEYCIQCifyfEyuQcGddos4CtsmauuzEVXsc4OG246jZ2vRplTwIhAJPKP0vI1tAYjjNlPnlKr1s4J3PaCqzNqqiRO/sPWrql","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38355691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTYilACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbChAAjVem0SfBBNxjaRY6JC4xN0o+3KP+gKPnYDC0PaO8H/Istt+C\r\nMXUJemYheCIqr2ecUn5HYQrTUuksFtNdUt1XNXa6LphG0tPaz0/PmozFTSWa\r\nSkY8/W5k3+ikzQbGlkiDke2Mq/WHRwlFWYaB/+nW69UZecvNO/JAQ1fdlGi9\r\nu4b6uRTHgBlopU7i8zc0HuMW+GE9+UChYkJ1WkoaxrRHzcj5HmePpBWdDNEi\r\n6XrpTz8/DFrufpEYVVKNZieMSGqGTfOo0Mgozn+uD2h43Wdm1+m65E5HKHsy\r\nGFA/J4B7RWOySYI6RAotjiF9mu5ISDtIKjuTGwH/SOcMKsz3IKCKGTsUpuE/\r\nO9kRdQ9HO0gg4KJdI1/mQYf/EdI26ZJNUNk4T5an63VyZpHskUoyks/Amd+o\r\nqYl8W6qrJ823Rq2gJbsxMEzLanOTGZ0LJ0kgovFr53UDyYZ74zBPy0mxvnhy\r\nd6vOlE2SoPpIHgX2MFo1XVR1pSiftoko9kvCNLyWlATd0swZwD/m/8Amf8TS\r\nUmuLl/Mi5OiFtU9gbbFY5uPZCcXEK7FEc7o1k++Pl+P6HjzWaEhU4sMIAlMe\r\n6Ko1WgzQpSeM728u0uIgrBctp1IVz6HN1Ob2x5+fCpkR+F3hJ33Dqr/IWSKa\r\nur8FEBgH0PYwn7nfGfJ8BaEk3OIeH4aLpmo=\r\n=CajV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"78e2d418c1d0c34c7fc95c4a556c8800c930a098","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"csuwildcat","email":"danieljb2@gmail.com"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"9.3.1","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.14.1","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.2_1682802853328_0.5319221037787134","host":"s3://npm-registry-packages"}},"0.6.2-unstable.c20647a-2023.5.02-21-01-31":{"name":"@tbd54566975/web5","version":"0.6.2-unstable.c20647a-2023.5.02-21-01-31","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.2-unstable.c20647a-2023.5.02-21-01-31","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"d48ee5cd839504d8093cc0a649c7337e1b0d54da","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.2-unstable.c20647a-2023.5.02-21-01-31.tgz","fileCount":42,"integrity":"sha512-cBk9CcZLzBF8AQYwLt7QkchCtmHlhuebTjcujdRbkGsGLUn7WlHWt9h9hh5L7MXng6tbjdegTJ9YKaIdgDvSfg==","signatures":[{"sig":"MEQCIBgILtd7le/coyGUw6FgdYGGKl15tK/e85UppB17MS1IAiBmIsfmJPpfUWKKv+lZg3tKSUSd9JZkNQgPy68puLdG6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39676524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUXo7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6xQ/+NiY8paAqBqEQGCsddhZzdFmIDRZxDjyxsCRgQHKk2CPVBOUm\r\nFfOlee6g9oigjvnfL/RlW86oNwzqzXb4k/aWNasoWwNt5FbrqGOmbkaxYdCE\r\nFTDCqhXK+iRLJ03QmlCclh2aI3SoK0YIoA9a2w3W+nKlxZa0wDuCGmsAur7K\r\n9mDIh+6VszCQKubgX+H+TcwaE6Imz5h6JiP4Gz6ZXF8fvRJlj7m6OSLTL+mN\r\nQMQPayvUVhqUVZwezXgdF/PQ5UrMi/IHS8sJyuwplwmHRI4ZOlvap7jXP+g0\r\nPQtKH3lgnFrUua1Tnvpt3vxmlPquqMb+qITNNWtUa4TPKPrm5/FVmarEsUdd\r\n1L5VKnBQdT1ZGmF33/pN+RhXH3G8zMyKtpPNxOcr5rGC3EZKd21l3GkBYjyu\r\nlVwtvUCKB5TdxZYjf//rA3bC8EejiSGA0tc0IMO+6bvnVutn0yGS6Ker1rEZ\r\nKKbKkFZJnn5tSdNiO7sCYfMD2pPTnufHyeydVuSpVuzssU5wmMPofuesOmIC\r\nz4oYZkH29zJrXQA8w3ScyUqbks6dZ1uMlHgi532bISqLwUGu4MHD4tav8cU6\r\n6EDeIhMb+SRpJbPBFFF+QNwGpdn4lEsQyhmGGsLUvG/VuLCHZzE8HZfTa6TY\r\nhHmt1rGVA9VLBY4Y0WzKUhriOKBK12clJII=\r\n=yiOM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n[API Reference](https://tbd54566975.github.io/web5-js/)\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` scope enables generation of DIDs for a supported set of DID Methods. The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to decentralized DID networks.\n\n#### **Example**\n\n```javascript\nconst myDid = await web5.did.create('ion');\n```\n\n### **`web5.did.manager.set(did, parameters)`**\n\nThe package provides a DID manager mechanism that handles interactions with a DID that is being 'managed' by the local code (be it in a web page, agent app, or elsewhere). By adding a DID to the manager, the library ensures that all interactions with that DID, including things like signing and encryption, are handled automatically.\n\n#### **Example**\n\nAssuming the `myDid` instance is present from the example above, you would pass the following values to add it to the DID manager:\n\n```javascript\nawait web5.did.manager.set(myDid.id, {\n    connected: true,\n    endpoint: 'app://dwn', //this points to the user's local DWN\n    keys: {\n        '#dwn': {\n          keyPair: myDid.keys.find(key => key.id === 'dwn').keyPair,\n        }\n    }\n});\n```\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n\nconsole.log(response.entries) // logs array of Record class instances\n```\n\n### **`web5.dwn.records.create(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst { record } = await web5.dwn.records.create('did:example:alice', {\n  author: 'did:example:alice',\n  data: 'Hello World!',\n  message: {\n    dataFormat: 'text/plain'\n  }\n});\n\nconsole.log(record.data.text()) // logs \"Hello World!\" in console\n```\n\n### **`Record` response instances**\n\nEvery modifying method (`create`, `write`, etc.) and query entries return an instance of `Record` class, which is a representation of the Record(s) involved. `Record` class instances have the following properties:\n\n- **`recordId`**  - *`string`*: The unique identifier based on the record entry's composition. Note: all entries across all records are deterministically unique.\n- **`descriptor`**  - *`object`*: The descriptor object for the constructed DWeb Node message.\n- **`data`**  - *`object`*: a object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`**  - *`function`*: produces a textual representation of the data.\n  - **`json`**  - *`function`*: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`**  - *`function`*: returns the raw stream of bytes for the data.\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\nFor this example we assume we have created the record and are using the output `Record` instance from above to overwrite the data of the record with a subsequent `write`:\n\n```javascript\nconst web5 = new Web5();\nconst { record } = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: 'Hello again!',\n  message: {\n    recordId: record.recordId,\n    dataFormat: 'text/plain'\n  }\n});\n\nconsole.log(record.data.text()) // prints \"Hello again!\" in console\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe configuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/audio\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {},\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"c20647a787500ce4718d23ef403c837eef6db13a","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.2-unstable.c20647a-2023.5.02-21-01-31_1683061307441_0.26736925915329346","host":"s3://npm-registry-packages"}},"0.6.3-unstable.467987f-2023.5.03-21-51-21":{"name":"@tbd54566975/web5","version":"0.6.3-unstable.467987f-2023.5.03-21-51-21","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.3-unstable.467987f-2023.5.03-21-51-21","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"e289172167883b5079600594cfde2adcc924b9a8","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.3-unstable.467987f-2023.5.03-21-51-21.tgz","fileCount":42,"integrity":"sha512-6NAASrIKfaS8mouih7r95z9lhov74h5X0FGyALCJMtWofjsxTo1qCHdbwJjuMLmo39koDAApFtu2mTRxYe33Ng==","signatures":[{"sig":"MEUCIQCL5ZdqKOOl+1voxBgaidPqbyv1fH/KUbSrTpYWh/gvTAIgSy17Ou7ZN8kDBe42kTxiTJQWUv3jwi90Jv0tsBWI1zA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39676524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUtdjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpkuA//eGu6YSOmNe5w/LkKioo8LHsg+88tlDsl87B/EqAhhlCoXiqW\r\nz4qXlkE3OcsIZp7t7DBZnMQ3Up+5ZQIJ1fmz7NRSWbtUjImEjP+NQhIhWh9v\r\ncX3iAoYCn1CSgirEZC85kq1AePkdrdrzPDCewxzH/XP+rpcmpAxmT01D6ryy\r\nPjcfomLlWVZ7KA5awkq6zdZ9WHulV7pCv0vNKxZlt8nCkNVKkI5a3xJZKeWK\r\nGrilNiWc7JGfDE3sAaSel7LcD5UCaYcz5MiEvm5fIAWcVUC5uvyCaNbaJ/3W\r\nJK++79cV9ic9lvQvjloRODKfLgNK2QVwulp2Xl1Is9SAjcGxV3WpEarGGfYv\r\nz0DMRe2pGSUsZez4A6+vhmAL5XAnU+1SV0JDO99Q2XUmvdWx1NALuG2RFdlM\r\ncR4AVv5NyeoEAuOiRbWnVocsN//E18aGOshWQe7USRUG/g3HnSqlGp+Qwagw\r\npQu1rLcRtMK39HRTo60fiVpEUbYDB7hJXo/cjgBoAxBTwRkeuP+c5fzThY/N\r\nXzntoaYSHb0FzNFdO0fSwsvgpkg0zHf59FER0mKWGKa+LDlN1jYpiHdHhFp/\r\nQ1z2RYRnbMYSHLFO6fyUCUweVQG2WZ/FvOC8lVM8i90+cOc64KoS7xLegUAd\r\n7uBaqrJnhJ5QQe6rQmFn3YqowXbXbZCbXDg=\r\n=gSId\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","readme":"# Web5 JS SDK\nMaking developing with Web5 components at least 5 times easier to work with.\n\n⚠️ WEB5 JS SDK IS IN A PRE-BETA STATE ⚠️\n\n## Introduction\n\nWeb5 consists of the following components:\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these \npillar technologies to provide a simple library that is as close to effortless as \npossible. \n\n## Docs\n\n[API Reference](https://tbd54566975.github.io/web5-js/)\n\n### **`new Web5([options])`**\n\nCreates an isolated API object for doing Web5 things, split into three main top-level objects: `did`, `dwn`, and `vc`.\n\n#### **`options`**\n\nWhen creating a `Web5` instance the following options can be provided:\n\n##### **`dwn`**\n\nThis object contains options related to `web5.dwn`.\n\n- **`node`**  - *`Dwn`*: A customizable `Dwn` instance to use instead of a default one created by `web5.dwn`. This can be used to customize the storage location/structure/etc. of the `Dwn`, how DIDs are resolved, etc..\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` scope enables generation of DIDs for a supported set of DID Methods. The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to decentralized DID networks.\n\n#### **Example**\n\n```javascript\nconst myDid = await web5.did.create('ion');\n```\n\n### **`web5.did.manager.set(did, parameters)`**\n\nThe package provides a DID manager mechanism that handles interactions with a DID that is being 'managed' by the local code (be it in a web page, agent app, or elsewhere). By adding a DID to the manager, the library ensures that all interactions with that DID, including things like signing and encryption, are handled automatically.\n\n#### **Example**\n\nAssuming the `myDid` instance is present from the example above, you would pass the following values to add it to the DID manager:\n\n```javascript\nawait web5.did.manager.set(myDid.id, {\n    connected: true,\n    endpoint: 'app://dwn', //this points to the user's local DWN\n    keys: {\n        '#dwn': {\n          keyPair: myDid.keys.find(key => key.id === 'dwn').keyPair,\n        }\n    }\n});\n```\n\n### **`web5.dwn.records.query(target, request)`**\n\nMethod for querying the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.query('did:example:bob', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      schema: 'https://schema.org/Playlist',\n      dataFormat: 'application/json'\n    }\n  }\n});\n\nconsole.log(response.entries) // logs array of Record class instances\n```\n\n### **`web5.dwn.records.create(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst { record } = await web5.dwn.records.create('did:example:alice', {\n  author: 'did:example:alice',\n  data: 'Hello World!',\n  message: {\n    dataFormat: 'text/plain'\n  }\n});\n\nconsole.log(record.data.text()) // logs \"Hello World!\" in console\n```\n\n### **`Record` response instances**\n\nEvery modifying method (`create`, `write`, etc.) and query entries return an instance of `Record` class, which is a representation of the Record(s) involved. `Record` class instances have the following properties:\n\n- **`recordId`**  - *`string`*: The unique identifier based on the record entry's composition. Note: all entries across all records are deterministically unique.\n- **`descriptor`**  - *`object`*: The descriptor object for the constructed DWeb Node message.\n- **`data`**  - *`object`*: a object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`**  - *`function`*: produces a textual representation of the data.\n  - **`json`**  - *`function`*: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`**  - *`function`*: returns the raw stream of bytes for the data.\n\n### **`web5.dwn.records.write(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n- **`data`**  - *`blob | stream | file`*: The data object of the bytes to be sent.\n\n#### **Example** \n\nFor this example we assume we have created the record and are using the output `Record` instance from above to overwrite the data of the record with a subsequent `write`:\n\n```javascript\nconst web5 = new Web5();\nconst { record } = await web5.dwn.records.write('did:example:alice', {\n  author: 'did:example:alice',\n  data: 'Hello again!',\n  message: {\n    recordId: record.recordId,\n    dataFormat: 'text/plain'\n  }\n});\n\nconsole.log(record.data.text()) // prints \"Hello again!\" in console\n```\n\n### **`web5.dwn.records.read(target, request)`**\n\nMethod for writing a record to the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe write `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`**  - *`string`*: the required record ID string that identifies the record data you are fetching.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.read('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.records.delete(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe delete `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`recordId`**  - *`string`*: the required record ID string that identifies the record being deleted.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.records.delete('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    recordId: 'bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5'\n  }\n});\n```\n\n### **`web5.dwn.protocols.query(target, request)`**\n\nMethod for querying the protocols that a `target` DID has added configurations for in their DWeb Node.\n\n#### **`request`**\n\nThe query `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`filter`**  - *`object`*: an object that defines a set of properties to filter results.\n      - **`protocol`**  - *`URI string`*: a URI that represents the protocol being queried for.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.query('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    filter: {\n      protocol: \"https://decentralized-music.org/protocol\",\n    }\n  }\n});\n```\n\n### **`web5.dwn.protocols.configure(target, request)`**\n\nMethod for deleting a record in the DWeb Node of a provided `target` DID.\n\n#### **`request`**\n\nThe configuration `request` must contain the following:\n\n- **`author`**  - *`string`*: The decentralized identifier of the DID signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`**  - *`object`*: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n    - **`protocol`**  - *`URI string`*: a URI that represents the protocol being configured via the `definition` object.\n    - **`definition`**  - *`object`*: an object that defines the ruleset that will be applied to the records and activities under the protocol.\n        - **`labels`**  - *`object`*: an object that defines the composition of records that will be used in the `records` tree below.\n        - **`records`**  - *`object`*: a recursive object that defines the structure of an app, including data relationships and constraints on which entities can perform various activities.\n\n#### **Example** \n\n```javascript\nconst web5 = new Web5();\nconst response = await web5.dwn.protocols.configure('did:example:alice', {\n  author: 'did:example:alice',\n  message: {\n    protocol: \"https://decentralized-music.org/protocol\",\n    definition: {\n      \"labels\": {\n        \"playlist\": {\n          \"schema\": \"https://decentralized-music.org/protocol/playlist\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"track\": {\n          \"schema\": \"https://decentralized-music.org/protocol/track\",\n          \"dataFormat\": [ \"application/json\" ]\n        },\n        \"audio\": {\n          \"schema\": \"https://decentralized-music.org/protocol/audio\",\n          \"dataFormat\": [ \"audio/aac\", \"audio/mp4\" ]\n        }\n      },\n      \"records\": {\n        \"playlist\": {},\n        \"track\": {\n          \"records\": {\n            \"audio\": {}\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n### **`web5.connect([options])`**\n\nEnables an app to request connection to a user's local identity app, or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action', which is something the browser/OS decides. For browsers this is generally some direct user intent, like clicking a link or button.\n\n#### **`options`**\n\nThe `connect` method optionally accepts an object with the following properties:\n\n##### **`storage`**\n\nUsed by `connect` to store connection data/keys/etc. for reuse when calling `connect` again (e.g. during another session).\n\nIf provided, `storage` must be an object that has the same methods as [`Storage`](/TBD54566975/web5-js/tree/main/src/storage/Storage.js).\n\nIf not provided, an instance of [`LocalStorage`](/TBD54566975/web5-js/tree/main/src/storage/LocalStorage.js) is used instead.\n\n##### **`connectionLocation`**\n\nControls where in `storage` the connection data is stored.\n\nDefaults to `'web5-connection'`.\n\n##### **`keysLocation`**\n\nControls where in `storage` the connection keys are stored.\n\nDefaults to `'web5-keys'`.\n\n##### **`silent`**\n\nControls whether to prompt the user to start a new connection if a connection has not already been established.\n\nDefaults to `false`.\n\n#### **Events**\n\nAfter calling `connect`, at least one of the following events will be dispatched on the `Web5` instance:\n\n##### **`'open'`**\n\nA `'open'` event is dispatched if a local identity app is found, containing a verification pin and port number used for the connection.\n\n- **`event.detail.pin`**  - *`number`*: 1-4 digit numerical code that must be displayed to the user to ensure they are connecting to the desired local identity app.\n- **`event.detail.port`** - *`number`*: The port number used by the the local identity app to listen for connections.\n\n##### **`'connection'`**\n\nA `'connection'` event is dispatched if the user accepts the connection, containing the DID the user selected in the local identity app.\n\n- **`event.details.did`**  - *`string`*: The DID selected by the user in the local identity app.\n\n##### **`'close'`**\n\nA `'close'` event is dispatched if the user refuses to accept or respond to the connection attempt for any reason.\n\n##### **`'error'`**\n\nAn `'error'` event is dispached if anything goes wrong (e.g. `Web5` was unable to find any local identity apps).\n\n#### **Example** \n\n```javascript\ndocument.querySelector('#connect_button').addEventListener('click', async event => {\n\n  event.preventDefault();\n\n  const web5 = new Web5();\n\n  web5.addEventListener('open', (event) => {\n    const { pin } = event.detail\n    document.querySelector('#pin_code_text').textContent = pin;\n  });\n\n  web5.addEventListener('connection', (event) => {\n    const { did } = event.detail\n    alert('Connection succeeded! Connected to DID: ' + did);\n  });\n\n  web5.addEventListener('close', (event) => {\n    alert('Connection was denied');\n  });\n\n  web5.addEventListener('error', (event) => {\n    console.error(event);\n  });\n\n  web5.connect();\n});\n```\n\n## Project Resources\n\n| Resource                                   | Description                                                                    |\n| ------------------------------------------ | ------------------------------------------------------------------------------ |\n| [CODEOWNERS](./CODEOWNERS)                 | Outlines the project lead(s)                                                   |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](./CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues     |\n| [GOVERNANCE.md](./GOVERNANCE.md)           | Project governance                                                             |\n| [LICENSE](./LICENSE)                       | Apache License, Version 2.0                                                    |","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"467987f34cb316abe73aa3f965b872b8ee68fb64","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.3-unstable.467987f-2023.5.03-21-51-21_1683150691235_0.22161462145766353","host":"s3://npm-registry-packages"}},"0.6.3":{"name":"@tbd54566975/web5","version":"0.6.3","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.6.3","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"e2421557b0741f4194f80254615cb5808ffc0f85","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.6.3.tgz","fileCount":42,"integrity":"sha512-LSteEXyMiS7Yh1a70/lCwjLNLwSud60gH9eRbjOL1Dh0Q/EPjVTOU/gGT6+X1AzCEEKoeRiUhKkk/WFrE5jOYg==","signatures":[{"sig":"MEYCIQDwlyARmJ6MUJZDjwddm9OazIlsklfVS+kHsBPiH8ct7wIhALvihFSY01FVPVIlataZ0jo2qP2KZjsQlZmBdxjQEahi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39676488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUtfXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDdw/+P+P0JJhwriBWoMXUNlANvryO82TwZgfdDe1/6WkBj2z65YjW\r\nrhOAzaMameMCuE35oibQZBBdZJgCsvKtyEAEk/swE0xy80o2NQ/5WLkjKhvn\r\nQwHcgI/J1OjHRC9w9syOYZdwzuFTLcLeNG+gUF1JeYU4qVUnyIVJXd5XAcCZ\r\n8rtxBRDh7NLKn3TlxBB1sAnuz6uin9uEzGOeceXjBHbkSyZ2bq+9bpJ77u1m\r\nE+F7MQJGDllX9s4d1bXzcWV8MxjyyQbLdCw2RttRRS4Gw+OThyef6IZJ68Yt\r\nc1omTx/9D+iHbiTVlygK4mCCBUPmrw8Kfp1Xhta8/LJeu9798QKxv8+UOTzZ\r\nm9Lvn4jyBF++ddiaOYAa112Ct8NV/qVaaM9nmPDKagvh3ZBY0kSOWUdPXt1g\r\ncZ3bh5FVYvhy+Xk0SEqUMIv35GbSYADeRaP3FOXyZH2IPk9m1HSwZwkKIbP+\r\nRHpAYs+BaOgWWpcHJrYSfQrtUj/uy+0qvDcvg8/QQGprexgeUQAQS7gAGmMo\r\nJ2zml/kUHETRMkbX6yYXwLDUtIPVzByddVrYShLgR4uZMHyd3t98SfHR01i8\r\nP4xChoLBJdXy5S977ukSfH58BNZNGyBcCo7OiBDVDzjndihcqexHWosLX9HU\r\n4NAK+TIHWp5jwLlu5yh6McecWy/EnTCMKF8=\r\n=Q/op\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/index.cjs","type":"module","module":"./dist/esm/index.mjs","browser":{"./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"},"./electron":{"import":"./dist/esm/index.mjs","require":"./dist/electron/index.cjs"}},"gitHead":"467987f34cb316abe73aa3f965b872b8ee68fb64","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","lint:fix":"eslint . --ext .js --fix","test:node":"mocha \"tests/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"8.18.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.8.0","dependencies":{"ed2curve":"0.3.0","tweetnacl":"1.0.3","cross-fetch":"3.1.5","@tbd54566975/dwn-sdk-js":"0.0.30","readable-web-to-node-stream":"3.0.2","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.36.0","rimraf":"4.4.0","esbuild":"0.16.17","karma-chai":"0.1.0","playwright":"1.31.2","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.6.3_1683150807145_0.8589560588312855","host":"s3://npm-registry-packages"}},"0.7.0-alpha-20230512-fb6a55d":{"name":"@tbd54566975/web5","version":"0.7.0-alpha-20230512-fb6a55d","keywords":[],"author":{"name":"Daniel Buchner","email":"dbuchner@tbd.email"},"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.0-alpha-20230512-fb6a55d","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"name":"Frank Hinek","email":"frankhinek@tbd.email"},{"name":"Moe Jangda","email":"moe@tbd.email"}],"dist":{"shasum":"8995c61ae3155545de1558f9bcec03d6d2abb452","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.0-alpha-20230512-fb6a55d.tgz","fileCount":34,"integrity":"sha512-X5WmdUYR6xBELgFw3211uC/jaZ3XRFYodQ/lLl9DHqpYnwvkNJg6XUtVZxI5R8Sa8MmiVu1EsQRtiOrFlyAdnA==","signatures":[{"sig":"MEQCIHpH0ksJOLjQyM5EEqGkrtVF00qcjqzsI5wUBL3dgXdGAiB/oDK5kql/FUeZ5wcAb9cV7MgGvK0++1GsDGDxXymHHw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":37501197},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","readme":"ERROR: No README data found!","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"5ee478fa9ac5fef103fa4b8de60d22bbf937d81a","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"tsc -p tsconfig.test.json && mocha \"__tests__/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs","publish:unstable":"./build/publish-unstable.sh"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","_npmVersion":"9.6.3","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"19.9.0","dependencies":{"ms":"2.1.3","level":"8.0.0","cross-fetch":"3.1.5","@tbd54566975/dids":"alpha","@tbd54566975/crypto":"alpha","@tbd54566975/dwn-sdk-js":"0.0.31-unstable-2023-05-10-816a0ef","@tbd54566975/web5-agent":"alpha","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"alpha","@tbd54566975/web5-proxy-agent":"alpha","@decentralized-identity/ion-tools":"1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","playwright":"1.31.2","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"^7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.0-alpha-20230512-fb6a55d_1683934076800_0.6130470961426846","host":"s3://npm-registry-packages"}},"0.7.0":{"name":"@tbd54566975/web5","version":"0.7.0","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.0","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"82a7cdfbbbaf4ee0b17ee2898fceefba4219bc55","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.0.tgz","fileCount":39,"integrity":"sha512-wq/NTxZvIsnLeZPsDQBA84lEEvooVHWkNOmlLmb0lfdA63hRRAfRkptxeJiQvg7Z8elhoPvysGAdQEIybZYMZg==","signatures":[{"sig":"MEQCIARElNYXIrnH9Q6LNTJ/cEx4xGkuYaY4itwIcjXirOAaAiAb0WghPMLEYUdgo+jOSpoKS04rQEse6PmvEkHeOXQGJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36345388},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/index.js":"./dist/browser.js","./dist/esm/index.js":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"71937dcf56f1a344c879316a7082b9a644bd9709","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && mocha \"__tests__/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.6","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","cross-fetch":"3.1.5","@tbd54566975/dids":"0.1.0","@tbd54566975/crypto":"0.1.0","@tbd54566975/dwn-sdk-js":"0.0.32-unstable-2023-05-15-1350300","@tbd54566975/web5-agent":"0.1.0","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.0","@tbd54566975/web5-proxy-agent":"0.1.0","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","playwright":"1.31.2","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.0_1684257158814_0.14485875999285414","host":"s3://npm-registry-packages"}},"0.7.1":{"name":"@tbd54566975/web5","version":"0.7.1","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.1","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"3b4f6e7eb6ef5ef98601a404b3b32d8d571d640a","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.1.tgz","fileCount":39,"integrity":"sha512-Oo5fT/etmzezBjNmkIE/IbDD+jpN3EFU7+FL098NAfqixcJYTuOmueQfFMDkLN8UFuh4IKwAZxEeafca/HXK/A==","signatures":[{"sig":"MEQCICjaaJhXneBfHxYD/veaRTG6pDFnvdzxujH+eP5Ye5PWAiAQUfstH/wtzVRrTpO3CymGPiy1mIfP5uHMMSknTfeIGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.1","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36348860},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"8710760d804ced907c09ce4dffe2ee661cbfa7e7","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && mocha \"__tests__/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.6","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","cross-fetch":"3.1.5","@tbd54566975/dids":"0.1.1","@tbd54566975/crypto":"0.1.1","@tbd54566975/dwn-sdk-js":"0.0.32","@tbd54566975/web5-agent":"0.1.1","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.1","@tbd54566975/web5-proxy-agent":"0.1.1","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","playwright":"1.31.2","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.1_1684414271973_0.6073975815737214","host":"s3://npm-registry-packages"}},"0.7.2":{"name":"@tbd54566975/web5","version":"0.7.2","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.2","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"2059dea83ae2829cfd02a269c6d70564a7b1d9fe","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.2.tgz","fileCount":39,"integrity":"sha512-sn+RIuwjyC15SbsoTykrA0VdRaM/CiBMGxY2RwnWcj9JdrdJ7hvYtwEMO+3eCLn7OU1nUbn3uuc/vJzofduihg==","signatures":[{"sig":"MEUCIQCVfzqJjCEDxmtUUagQnbZEhgcPONrgpLv1/YIIUEuztQIgZoJPOZRTGqIWXbhcRmSWJ8+Sf+NrO3TBEMnw7RuRP6g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.2","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36348840},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"9bc7bcde607bde9701c31c35a8699a853c3105c2","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && mocha \"__tests__/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","cross-fetch":"3.1.5","@tbd54566975/dids":"0.1.2","@tbd54566975/crypto":"0.1.2","@tbd54566975/dwn-sdk-js":"0.0.32","@tbd54566975/web5-agent":"0.1.2","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.2","@tbd54566975/web5-proxy-agent":"0.1.2","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","playwright":"1.31.2","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.2_1684425425528_0.32645293473912407","host":"s3://npm-registry-packages"}},"0.7.3":{"name":"@tbd54566975/web5","version":"0.7.3","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.3","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"5d6231681c8c644bfd1683eed3d22a54d27ca892","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.3.tgz","fileCount":39,"integrity":"sha512-hM909KuahQgSQeIjY639+2zi8fYe8SIB+houfWOlh10Kaqk9hH9WPTz1SsVkbn6mUPr8h0t5Z9rHY4XlfdmC9Q==","signatures":[{"sig":"MEUCIF469zMuxPKE+VUmcyC6e2DomjWPRX3b1wv0IisiId2zAiEA1lVBJ3q4yw4xooe/SdFBANOm/lWN7S1HKmK+YU03+Yg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.3","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36375833},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"12435a10778ba84ef888d596e789d94dde135548","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && mocha \"__tests__/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","cross-fetch":"3.1.5","@tbd54566975/dids":"0.1.3","@tbd54566975/crypto":"0.1.3","@tbd54566975/dwn-sdk-js":"0.0.32","@tbd54566975/web5-agent":"0.1.3","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.3","@tbd54566975/web5-proxy-agent":"0.1.3","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","playwright":"1.31.2","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.3_1684519648756_0.515877807815476","host":"s3://npm-registry-packages"}},"0.7.4":{"name":"@tbd54566975/web5","version":"0.7.4","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.4","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"ac2043ba3b462860f90a9f9c65ee1ddd4bc87652","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.4.tgz","fileCount":39,"integrity":"sha512-TuZdgMrwqrxy8PQ5fqZxAQlUC0pYTj5Spcu501Z8R1JNiZ6qjnDqVILOPv6Qww8Rmb3sHuvqsEO9sHWJmPqyaQ==","signatures":[{"sig":"MEUCIGxGS1erdpO95xMaEoRK8iVF11DgY1I0CFACp/luomw1AiEAjG0Z5OAy4LQYsphEwljtlt4KuTu87GOa0fpprgFCR74=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.4","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36495738},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"55743fdb3473afbc5c41a547b5f59cdedc1010de","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && mocha \"__tests__/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","cross-fetch":"3.1.5","@tbd54566975/dids":"0.1.4","@tbd54566975/crypto":"0.1.4","@tbd54566975/dwn-sdk-js":"0.0.32","@tbd54566975/web5-agent":"0.1.4","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.4","@tbd54566975/web5-proxy-agent":"0.1.4","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","playwright":"1.31.2","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.4_1684595679504_0.4222170481236964","host":"s3://npm-registry-packages"}},"0.7.5":{"name":"@tbd54566975/web5","version":"0.7.5","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.5","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"17b6157e63620d0fbe368d42c2f20fdf3d891d00","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.5.tgz","fileCount":41,"integrity":"sha512-ijZIuvBManFcTfbMTPorb4UOztbUndARY7b4jxC9DO9qewmYGxvUYmQh01UgmnAiIwdRA42N8cUN36F8j+HzfA==","signatures":[{"sig":"MEYCIQDCBADcKS0Rzf4mXXcVgk2BUg+5YZSm+eXnORWxGxP6DgIhALGmuMlU8lNe4gwPpy4R+FnTNt34KSbhrI7FobchEzy/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.5","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36537872},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"6a932125032117a1f2275bf68e15b966b18139ed","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && mocha \"__tests__/**/*.spec.js\" --exit","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","cross-fetch":"3.1.5","@tbd54566975/dids":"0.1.5","@tbd54566975/crypto":"0.1.4","@tbd54566975/dwn-sdk-js":"0.0.32","@tbd54566975/web5-agent":"0.1.4","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.5","@tbd54566975/web5-proxy-agent":"0.1.4","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","playwright":"1.31.2","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/sinon":"^10.0.15","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.5_1684824510436_0.3345293297247567","host":"s3://npm-registry-packages"}},"0.7.6":{"name":"@tbd54566975/web5","version":"0.7.6","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.6","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"049aa29439a70ea523ddcdc4b6bb56f25f968085","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.6.tgz","fileCount":41,"integrity":"sha512-D5rOg+eBqB4dlZce5D60r8kwZ02vd3RlrOtF+rTclVcu1As5PPAhi98rVDdENMP7tLT9jCVs+ry2YnCjGLntLw==","signatures":[{"sig":"MEYCIQCWxZjHpf5FNc/Oz1fROB1Npk/ct/sl8sFAtuiVcoA1XQIhAOvV4lep2pVKV+DZ4spydkE2FBF2qNS5Ck8bQRM58F/F","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.6","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36520978},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"2ac756f70f4c25c3bad85511e9469fcb9dce75fd","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"overrides":{"socket.io-parser@>4.0.4 <4.2.3":"4.2.3"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.6","@tbd54566975/crypto":"0.1.4","@tbd54566975/dwn-sdk-js":"0.0.33","@tbd54566975/web5-agent":"0.1.5","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.6","@tbd54566975/web5-proxy-agent":"0.1.5","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"7.14.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","playwright":"1.31.2","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.6_1685647107357_0.8106984621390445","host":"s3://npm-registry-packages"}},"0.7.7":{"name":"@tbd54566975/web5","version":"0.7.7","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.7","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"de28d38e3aa27323d74977318d0e575ce837e0cb","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.7.tgz","fileCount":41,"integrity":"sha512-ta02vZVo2hDAhTWCXtJAzgGpuFZ7fhlOaA12DIPkux/UzIrNTwOu4cb/qjx5CDQgIZm/DVPKtgvo3rhW6+e4pw==","signatures":[{"sig":"MEQCIAc1l5Uu0w8cd2pEyQumG4gm2nsNr2EHsdE1mSOeRt/4AiAMqgwM4hhdTDxVXGrSH6niTnL9DizzqkiFIVFTRbt0uw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.7","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36537874},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"d1afd130631cac8d22814b1efe3a7f80586ae566","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"overrides":{"socket.io-parser@>4.0.4 <4.2.3":"4.2.3"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.6","@tbd54566975/crypto":"0.1.4","@tbd54566975/dwn-sdk-js":"0.0.33","@tbd54566975/web5-agent":"0.1.5","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.6","@tbd54566975/web5-proxy-agent":"0.1.5","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"7.14.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.7_1685746148645_0.30849056234999606","host":"s3://npm-registry-packages"}},"0.7.8":{"name":"@tbd54566975/web5","version":"0.7.8","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.8","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"f611ab0b522c3f6f552aa43ad8eff2f78a2b4994","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.8.tgz","fileCount":41,"integrity":"sha512-jB425kn6YzJoO2ADOwyIYB+QLzP33fCVshIM+ezeCt3+7t2yYrZ9zjUATud1pUalotWVCbWjfKx6vD7CNZHS2w==","signatures":[{"sig":"MEQCIE3ZVsr3w3UGNSkAmXKuU0eoYB3KhJvJA4wjFC+DLHicAiABRfR1yihciPhrCIOPcMUJGzxtbDUxozq1RoiKiBOToQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.8","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36540808},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"296fdf7bce330b973346119f2fc4f95918483b4a","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"overrides":{"socket.io-parser@>4.0.4 <4.2.3":"4.2.3"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.6","@tbd54566975/crypto":"0.1.4","@tbd54566975/dwn-sdk-js":"0.0.33","@tbd54566975/web5-agent":"0.1.5","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.7","@tbd54566975/web5-proxy-agent":"0.1.5","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"7.14.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.8_1686103514392_0.6281918081549411","host":"s3://npm-registry-packages"}},"0.7.8-alpha-20230608-49f8e7b":{"name":"@tbd54566975/web5","version":"0.7.8-alpha-20230608-49f8e7b","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.8-alpha-20230608-49f8e7b","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"e5b67a68a71b49e342768ccf6cc087b006cb46d1","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.8-alpha-20230608-49f8e7b.tgz","fileCount":41,"integrity":"sha512-HHtbn+DZa3ronbNx8EAdGd/dYSsOrG/mBXCriRdig2D7K4ddvvOM09Q/n54WLdqvAjepkqnnIpZp8BWiCtxRaA==","signatures":[{"sig":"MEQCICsIxkxQj1oGsh4+8oYdFq7a2INEqxGuJi2yQeyaaVMpAiAaYAcmfDufPn9Sh1EKLEwUt44he6wmoIlC80qNCEQTZg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.8-alpha-20230608-49f8e7b","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36543452},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Docs\n\n### Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.8/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.8/dist/browser.mjs\n```\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query()`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create()`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_: tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write()`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read()`**\n\nMethod for reading a record stored in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete()`**\n\nMethod for deleting a record stored in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure()`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormat: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormat: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormat: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`from`** - _`string`_: The decentralized identifier signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query()`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods. The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"49f8e7b2c45066017d24b0e2bf3779a442647f39","scripts":{"lint":"eslint . --ext .js --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .js --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"overrides":{"socket.io-parser@>4.0.4 <4.2.3":"4.2.3"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.7.1","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.6","@tbd54566975/crypto":"0.1.4","@tbd54566975/dwn-sdk-js":"0.0.33","@tbd54566975/web5-agent":"0.1.5","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.7","@tbd54566975/web5-proxy-agent":"0.1.5","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"7.14.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.8-alpha-20230608-49f8e7b_1686229800327_0.18115105260440334","host":"s3://npm-registry-packages"}},"0.7.9":{"name":"@tbd54566975/web5","version":"0.7.9","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.9","maintainers":[{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"f369d69b763451d7771b7fa0455694f3cc106bb8","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.9.tgz","fileCount":44,"integrity":"sha512-6UxxBP9ZinECtTqhvm9m/AbjRlAb5LHPZ43wDKHTTEGPyhHaaY4GaNRG3wNWXgPLF42qLJFq31gnWbznDzxS0g==","signatures":[{"sig":"MEYCIQCjHurssAuCczJTnuncwEXs1ftGirLIPOrpVNxxlcYkhAIhAP8qMVitGMnKjLDkOTNNFO2xhC6rsHHuLu8zjkrjNXif","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.9","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36550388},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"d1e2d1003a46542e7c06bfd90156a830933eeef0","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .ts --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"overrides":{"socket.io-parser@>4.0.4 <4.2.3":"4.2.3"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.7.1","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.6","@tbd54566975/crypto":"0.1.4","@tbd54566975/dwn-sdk-js":"0.0.33","@tbd54566975/web5-agent":"0.1.5","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.8","@tbd54566975/web5-proxy-agent":"0.1.5","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"7.14.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.9_1686618216642_0.45203185119775413","host":"s3://npm-registry-packages"}},"0.7.9-alpha-20230622-5d57e26":{"name":"@tbd54566975/web5","version":"0.7.9-alpha-20230622-5d57e26","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.9-alpha-20230622-5d57e26","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"b99339531dba9a0bd29b122cb1af75479da393f0","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.9-alpha-20230622-5d57e26.tgz","fileCount":44,"integrity":"sha512-I3DkQ7w9DVPM/ybJMkdjunaJuGj5YB7Sw+mEmDsE1BrT0v+xBWDaZNHS1VTT9GtRri+lJPRBd3Mok6cyCgK7Hg==","signatures":[{"sig":"MEUCICekpYb+5DQux7MDBEg1/IdwIhW6YCHC4tR7M4vEb7LOAiEA7hDzgaGvdEedkdDYB4Bf/7SxRSeuxu4RYWbiz3DJRfA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.9-alpha-20230622-5d57e26","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":36550412},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Docs\n\n### Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.9/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.9/dist/browser.mjs\n```\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query()`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create()`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_: tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write()`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read()`**\n\nMethod for reading a record stored in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete()`**\n\nMethod for deleting a record stored in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure()`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormat: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormat: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormat: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`from`** - _`string`_: The decentralized identifier signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query()`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods. The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"5d57e26ed24de63a9d02a05b5eff1556a829e7f0","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .ts --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"overrides":{"socket.io-parser@>4.0.4 <4.2.3":"4.2.3"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.7.2","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.7","@tbd54566975/crypto":"0.1.4","@tbd54566975/dwn-sdk-js":"0.0.33","@tbd54566975/web5-agent":"0.1.5","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.8","@tbd54566975/web5-proxy-agent":"0.1.5","@decentralized-identity/ion-tools":"1.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"7.14.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.9-alpha-20230622-5d57e26_1687454020872_0.7144385573381871","host":"s3://npm-registry-packages"}},"0.7.9-alpha-20230623-69ab8a5":{"name":"@tbd54566975/web5","version":"0.7.9-alpha-20230623-69ab8a5","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.9-alpha-20230623-69ab8a5","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"32741410ebb5044f46b9e88af50a4a65ed60f26c","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.9-alpha-20230623-69ab8a5.tgz","fileCount":44,"integrity":"sha512-1HgNKz4k074YLukUGga8UzZZs61cHEMxlFiXKE4Q/q2uSQ4dYljSQPQtHbypQ5nYEHmG6dl1BGlsuYq0yto5Yw==","signatures":[{"sig":"MEQCIE/tqAVEgUjjUIbE+4WvSO+CDXmHLqX5D/hPohRXOupfAiAZHXNrIEjmmimA8dpFPDgnnUliU92ObZKelmd1IWQ9NA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.9-alpha-20230623-69ab8a5","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":24773171},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Docs\n\n### Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.9/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.9/dist/browser.mjs\n```\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query()`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create()`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_: tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write()`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read()`**\n\nMethod for reading a record stored in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete()`**\n\nMethod for deleting a record stored in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure()`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormat: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormat: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormat: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`from`** - _`string`_: The decentralized identifier signing the query. This may be the same as the `target` parameter if the target and the signer of the query are the same entity, which is common for an app querying the DWeb Node of its own user.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query()`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods. The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"69ab8a55bddf8739206e5da01e66277616bd6d9f","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .ts --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"overrides":{"socket.io-parser@>4.0.4 <4.2.3":"4.2.3"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.7.2","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.7","@tbd54566975/crypto":"0.1.4","@tbd54566975/dwn-sdk-js":"0.0.35","@tbd54566975/web5-agent":"0.1.5","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.8","@tbd54566975/web5-proxy-agent":"0.1.5","@decentralized-identity/ion-tools":"1.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.9-alpha-20230623-69ab8a5_1687547614590_0.2663597257908714","host":"s3://npm-registry-packages"}},"0.7.10":{"name":"@tbd54566975/web5","version":"0.7.10","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.10","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"ce952ecb7a79e6e3311e00c0526dd8890b5fb9d8","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.10.tgz","fileCount":44,"integrity":"sha512-FCOWXVB6IXGIfugTUZxWjfdu+LrxMgPBJdmm6YnTeNefpOiDWVD8SAvIQ+bKb1uagZ8LZwpRhqv0OWS3siikZw==","signatures":[{"sig":"MEQCIFGQSp9SkLh13p0EFn4lMCVOZMS1uK93nGdVeV2f0xxBAiB5d8EX9cHC+q+IW7OPbNZv+eLYXbfmgWPIrJ78t3POcQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.10","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":24773314},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"def410439650caa39667d2653d4b92cac6f9cde9","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .ts --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"overrides":{"socket.io-parser@>4.0.4 <4.2.3":"4.2.3"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.7.2","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.8","@tbd54566975/crypto":"0.1.5","@tbd54566975/dwn-sdk-js":"0.0.35","@tbd54566975/web5-agent":"0.1.6","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.9","@tbd54566975/web5-proxy-agent":"0.1.6","@decentralized-identity/ion-tools":"1.1.1"},"react-native":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/esm/main.mjs","./dist/esm/main.mjs":"./dist/esm/main.mjs"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.10_1687833741424_0.6227622722938513","host":"s3://npm-registry-packages"}},"0.7.11":{"name":"@tbd54566975/web5","version":"0.7.11","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.11","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"1c3db61b2367476686c3e0ad9a21023b2ac9603a","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.11.tgz","fileCount":44,"integrity":"sha512-qeCdxsfChCWwAXmbB0rPkIAerfm7iOohUL6GAJenuNH9N7Czboxu5X8QobsSm8Bcj4lKS9Ci0UP0FYb/8zlAMQ==","signatures":[{"sig":"MEUCIQCYepMGseEmKBI5VW6g6TnMWnO2j6XaELa0RzRPQh95lgIgGs83y4cc1ACNSbwQ1ci+qbC5y9Praw3Sd/fYLUVKkHI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.11","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":25656911},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"128c22abea3ec8eb0386bd5538df170614671b4b","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .ts --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"overrides":{"socket.io-parser@>4.0.4 <4.2.3":"4.2.3"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.8.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.1","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.9","@tbd54566975/crypto":"0.1.6","@tbd54566975/dwn-sdk-js":"0.0.37","@tbd54566975/web5-agent":"0.1.7","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.10","@tbd54566975/web5-proxy-agent":"0.1.7","@decentralized-identity/ion-tools":"1.1.1"},"react-native":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/esm/main.mjs","./dist/esm/main.mjs":"./dist/esm/main.mjs"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.11_1688748174346_0.2749168771023305","host":"s3://npm-registry-packages"}},"0.7.11-alpha-20230713-d1dda95":{"name":"@tbd54566975/web5","version":"0.7.11-alpha-20230713-d1dda95","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.11-alpha-20230713-d1dda95","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"bb6094e5143e39b58f73697198a5cc878629e455","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.11-alpha-20230713-d1dda95.tgz","fileCount":44,"integrity":"sha512-62kuKu632QrYS6lGiReJO8RZIMRYZFNvf4U+lhL7THEgBcjTksacHdoE8Aub0/u+DfmPWHVYcV3Pwj9cGFqjGQ==","signatures":[{"sig":"MEUCIQCoYcUhlAdbd6M4BfhydqCODB+esDna/hxQcHZ1cywqIAIgM8K5y8r8Fl6dWpK+/iV47a3jM72zkiaQI0XNvnBU4bE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.11-alpha-20230713-d1dda95","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":29123796},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n  - [Web5.connect](#web5connectoptions)\n  - [web5.dwn.records.query](#web5dwnrecordsqueryrequest)\n  - [web5.dwn.records.create](#web5dwnrecordscreaterequest)\n  - [web5.dwn.records.write](#web5dwnrecordswriterequest)\n  - [web5.dwn.records.read](#web5dwnrecordsreadrequest)\n  - [web5.dwn.records.delete](#web5dwnrecordsdeleterequest)\n  - [web5.dwn.protocols.configure](#web5dwnprotocolsconfigurerequest)\n  - [web5.dwn.protocols.query](#web5dwnprotocolsqueryrequest)\n  - [web5.did.create](#web5didcreatemethod-options)\n- [Project Resources](#project-resources)\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.11/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.11/dist/browser.mjs\n```\n\n## Usage\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### Additional Steps\n\nThis SDK relies indirectly on the [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519#usage)\nand [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1#usage) packages. Therefore,\nin certain environments, you'll need to perform additional steps to make it work.\n\n- Node.js <= 18\n\n```js\n// node.js 18 and earlier,  needs globalThis.crypto polyfill\nimport { webcrypto } from \"node:crypto\";\n// @ts-ignore\nif (!globalThis.crypto) globalThis.crypto = webcrypto;\n```\n\n- React Native:\n\n```js\n// If you're on react native. React Native needs crypto.getRandomValues polyfill and sha512\nimport \"react-native-get-random-values\";\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\ned.etc.sha512Sync = (...m) => sha512(ed.etc.concatBytes(...m));\ned.etc.sha512Async = (...m) => Promise.resolve(ed.etc.sha512Sync(...m));\n\nsecp.etc.hmacSha256Sync = (k, ...m) =>\n  hmac(sha256, k, secp.etc.concatBytes(...m));\nsecp.etc.hmacSha256Async = (k, ...m) =>\n  Promise.resolve(secp.etc.hmacSha256Sync(k, ...m));\n```\n\n## API Documentation\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query(request)`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create(request)`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_ (_optional_): tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write(request)`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read(request)`**\n\nMethod for reading a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete(request)`**\n\nMethod for deleting a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure(request)`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormats: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormats: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormats: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormats`** - _`Media Type string[]`_ (_optional_): Array of the IANA strings corresponding with the formats of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query(request)`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_ (_optional_): properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods ('ion'|'key'). The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"d1dda95e13de669c786df01abd9dda741b189520","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .ts --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.8.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.1","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.9","@tbd54566975/crypto":"0.1.6","@tbd54566975/dwn-sdk-js":"0.0.37","@tbd54566975/web5-agent":"0.1.7","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.10","@tbd54566975/web5-proxy-agent":"0.1.7","@decentralized-identity/ion-tools":"1.1.1"},"react-native":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/esm/main.mjs","./dist/esm/main.mjs":"./dist/esm/main.mjs"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.11-alpha-20230713-d1dda95_1689217280875_0.4228139360800476","host":"s3://npm-registry-packages"}},"0.7.11-alpha-20230713-3f5d2c2":{"name":"@tbd54566975/web5","version":"0.7.11-alpha-20230713-3f5d2c2","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.11-alpha-20230713-3f5d2c2","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"36011f078a49f3288e56cd84fa327571c8e650de","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.11-alpha-20230713-3f5d2c2.tgz","fileCount":44,"integrity":"sha512-bkw3gRhzdJY2EOWnbeZmBT+Z6ndAg9WkgeidJai8N1eWdkYElXexD67Me2VMqLpl7t5cgcfAIBH3CsCzuii1eQ==","signatures":[{"sig":"MEYCIQDhOQe7U9LX98bx2t26/vOCx1L+hvqDOWzZUf4nKaOmMwIhAMHGoKT57aEz6xOQugrrNsMM6j2kwW7kfVJxLqaqZmUo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.11-alpha-20230713-3f5d2c2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":29124570},"main":"./dist/cjs/main.cjs","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.mjs","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n  - [Web5.connect](#web5connectoptions)\n  - [web5.dwn.records.query](#web5dwnrecordsqueryrequest)\n  - [web5.dwn.records.create](#web5dwnrecordscreaterequest)\n  - [web5.dwn.records.write](#web5dwnrecordswriterequest)\n  - [web5.dwn.records.read](#web5dwnrecordsreadrequest)\n  - [web5.dwn.records.delete](#web5dwnrecordsdeleterequest)\n  - [web5.dwn.protocols.configure](#web5dwnprotocolsconfigurerequest)\n  - [web5.dwn.protocols.query](#web5dwnprotocolsqueryrequest)\n  - [web5.did.create](#web5didcreatemethod-options)\n- [Project Resources](#project-resources)\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.11/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.11/dist/browser.mjs\n```\n\n## Usage\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### Additional Steps\n\nThis SDK relies indirectly on the [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519#usage)\nand [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1#usage) packages. Therefore,\nin certain environments, you'll need to perform additional steps to make it work.\n\n- Node.js <= 18\n\n```js\n// node.js 18 and earlier,  needs globalThis.crypto polyfill\nimport { webcrypto } from \"node:crypto\";\n// @ts-ignore\nif (!globalThis.crypto) globalThis.crypto = webcrypto;\n```\n\n- React Native:\n\n```js\n// If you're on react native. React Native needs crypto.getRandomValues polyfill and sha512\nimport \"react-native-get-random-values\";\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\ned.etc.sha512Sync = (...m) => sha512(ed.etc.concatBytes(...m));\ned.etc.sha512Async = (...m) => Promise.resolve(ed.etc.sha512Sync(...m));\n\nsecp.etc.hmacSha256Sync = (k, ...m) =>\n  hmac(sha256, k, secp.etc.concatBytes(...m));\nsecp.etc.hmacSha256Async = (k, ...m) =>\n  Promise.resolve(secp.etc.hmacSha256Sync(k, ...m));\n```\n\n## API Documentation\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query(request)`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create(request)`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_ (_optional_): tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write(request)`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read(request)`**\n\nMethod for reading a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete(request)`**\n\nMethod for deleting a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure(request)`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormats: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormats: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormats: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormats`** - _`Media Type string[]`_ (_optional_): Array of the IANA strings corresponding with the formats of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query(request)`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_ (_optional_): properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods ('ion'|'key'). The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","browser":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/browser.js","./dist/esm/main.mjs":"./dist/browser.mjs"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/cjs/main.cjs"},"./browser":{"types":"./dist/types/main.d.ts","import":"./dist/browser.mjs","require":"./dist/browser.js"},"./electron":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.mjs","require":"./dist/electron/main.cjs"}},"gitHead":"3f5d2c23fa26fe9785dbd1243c05ac6d8d89844d","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc","lint:fix":"eslint . --ext .ts --fix","test:node":"rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha","test:browser":"karma start karma.conf.cjs"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.8.0","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.16.1","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.9","@tbd54566975/crypto":"0.1.6","@tbd54566975/dwn-sdk-js":"0.0.37","@tbd54566975/web5-agent":"0.1.7","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.10","@tbd54566975/web5-proxy-agent":"0.1.7","@decentralized-identity/ion-tools":"1.1.1"},"react-native":{"types":"./dist/types/main.d.ts","./dist/cjs/main.cjs":"./dist/esm/main.mjs","./dist/esm/main.mjs":"./dist/esm/main.mjs"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.0.4","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.11-alpha-20230713-3f5d2c2_1689220966154_0.2516385759425186","host":"s3://npm-registry-packages"}},"0.7.11-alpha-20230728-c6d0363":{"name":"@tbd54566975/web5","version":"0.7.11-alpha-20230728-c6d0363","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.11-alpha-20230728-c6d0363","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"fcd33adf7fb87bbff9a4aa499e26d90c61df0b43","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.11-alpha-20230728-c6d0363.tgz","fileCount":58,"integrity":"sha512-XO/rTPYMOmjTSpCaERQTPfL8qWgfXPbuD2JiOx9uFdDsWJiBLykmkR4SLAh7JgZI6UV5anPrMqaehEmHFz8qqw==","signatures":[{"sig":"MEUCIQD3f02ZfKxF1E9n2AVXy5gta8XdBil9xzIMc7lEss17UAIgJAr5smSxa1rad+IQOLs96hYb+awHUfvcuoUnofySUKs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.11-alpha-20230728-c6d0363","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":21093783},"main":"./dist/cjs/main.js","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.js","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n  - [Web5.connect](#web5connectoptions)\n  - [web5.dwn.records.query](#web5dwnrecordsqueryrequest)\n  - [web5.dwn.records.create](#web5dwnrecordscreaterequest)\n  - [web5.dwn.records.write](#web5dwnrecordswriterequest)\n  - [web5.dwn.records.read](#web5dwnrecordsreadrequest)\n  - [web5.dwn.records.delete](#web5dwnrecordsdeleterequest)\n  - [web5.dwn.protocols.configure](#web5dwnprotocolsconfigurerequest)\n  - [web5.dwn.protocols.query](#web5dwnprotocolsqueryrequest)\n  - [web5.did.create](#web5didcreatemethod-options)\n- [Project Resources](#project-resources)\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.11/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.11/dist/browser.mjs\n```\n\n## Usage\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### Additional Steps\n\nThis SDK relies indirectly on the [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519#usage)\nand [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1#usage) packages. Therefore,\nin certain environments, you'll need to perform additional steps to make it work.\n\n- Node.js <= 18\n\n```js\n// node.js 18 and earlier,  needs globalThis.crypto polyfill\nimport { webcrypto } from \"node:crypto\";\n// @ts-ignore\nif (!globalThis.crypto) globalThis.crypto = webcrypto;\n```\n\n- React Native:\n\n```js\n// If you're on react native. React Native needs crypto.getRandomValues polyfill and sha512\nimport \"react-native-get-random-values\";\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\ned.etc.sha512Sync = (...m) => sha512(ed.etc.concatBytes(...m));\ned.etc.sha512Async = (...m) => Promise.resolve(ed.etc.sha512Sync(...m));\n\nsecp.etc.hmacSha256Sync = (k, ...m) =>\n  hmac(sha256, k, secp.etc.concatBytes(...m));\nsecp.etc.hmacSha256Async = (k, ...m) =>\n  Promise.resolve(secp.etc.hmacSha256Sync(k, ...m));\n```\n\n## API Documentation\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query(request)`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create(request)`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_ (_optional_): tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write(request)`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read(request)`**\n\nMethod for reading a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete(request)`**\n\nMethod for deleting a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure(request)`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormats: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormats: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormats: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormats`** - _`Media Type string[]`_ (_optional_): Array of the IANA strings corresponding with the formats of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query(request)`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_ (_optional_): properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods ('ion'|'key'). The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.js","require":"./dist/cjs/main.js"}},"gitHead":"c6d036384afdc212810bc895e3a75ea0c062c62f","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"npm run clean && npm run build:esm && npm run build:cjs && npm run build:browser","clean":"rimraf dist tests/compiled","lint:fix":"eslint . --ext .ts --fix","build:cjs":"rimraf dist/cjs && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","build:esm":"rimraf dist/esm dist/types && npx tsc -p tsconfig.json","test:node":"rimraf tests/compiled && tsc -p tests/tsconfig.json && c8 mocha","test:browser":"karma start karma.conf.cjs","build:browser":"rimraf dist/browser.mjs dist/browser.js && node build/bundles.js"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.8.1","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.17.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.9","@tbd54566975/crypto":"0.1.6","@tbd54566975/dwn-sdk-js":"0.1.0-unstable-2023-07-18-09-24-a78a613","@tbd54566975/web5-agent":"0.1.7","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.10","@tbd54566975/web5-proxy-agent":"0.1.7","@decentralized-identity/ion-tools":"1.1.1"},"react-native":"./dist/esm/main.js","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.1.6","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.11-alpha-20230728-c6d0363_1690525138930_0.6357964410779393","host":"s3://npm-registry-packages"}},"0.7.11-alpha-20230728-527e57a":{"name":"@tbd54566975/web5","version":"0.7.11-alpha-20230728-527e57a","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.7.11-alpha-20230728-527e57a","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"b47c374cedfaf5025d0d382abd0e1d403cbaec1e","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.7.11-alpha-20230728-527e57a.tgz","fileCount":58,"integrity":"sha512-7DRp0i7kpcRs4x2NZKYWOiLEUhY+SqbvPwyqE4eFkMeeOjexc91uv6v4eKU9IfxXMnsjJM3ydzzqt+39OoKYAQ==","signatures":[{"sig":"MEYCIQC5RgegKWV+HpXKOM2GS2MnI0GOsd+9zxe2jrOYv05+KwIhAM5aiXzGbXTY/NwtZxl7mxcORaQM95fbynifYi4t4IQd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tbd54566975%2fweb5@0.7.11-alpha-20230728-527e57a","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":19511143},"main":"./dist/cjs/main.js","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.js","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n  - [Web5.connect](#web5connectoptions)\n  - [web5.dwn.records.query](#web5dwnrecordsqueryrequest)\n  - [web5.dwn.records.create](#web5dwnrecordscreaterequest)\n  - [web5.dwn.records.write](#web5dwnrecordswriterequest)\n  - [web5.dwn.records.read](#web5dwnrecordsreadrequest)\n  - [web5.dwn.records.delete](#web5dwnrecordsdeleterequest)\n  - [web5.dwn.protocols.configure](#web5dwnprotocolsconfigurerequest)\n  - [web5.dwn.protocols.query](#web5dwnprotocolsqueryrequest)\n  - [web5.did.create](#web5didcreatemethod-options)\n- [Project Resources](#project-resources)\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.11/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.11/dist/browser.mjs\n```\n\n## Usage\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### Additional Steps\n\nThis SDK relies indirectly on the [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519#usage)\nand [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1#usage) packages. Therefore,\nin certain environments, you'll need to perform additional steps to make it work.\n\n- Node.js <= 18\n\n```js\n// node.js 18 and earlier,  needs globalThis.crypto polyfill\nimport { webcrypto } from \"node:crypto\";\n// @ts-ignore\nif (!globalThis.crypto) globalThis.crypto = webcrypto;\n```\n\n- React Native:\n\n```js\n// If you're on react native. React Native needs crypto.getRandomValues polyfill and sha512\nimport \"react-native-get-random-values\";\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\ned.etc.sha512Sync = (...m) => sha512(ed.etc.concatBytes(...m));\ned.etc.sha512Async = (...m) => Promise.resolve(ed.etc.sha512Sync(...m));\n\nsecp.etc.hmacSha256Sync = (k, ...m) =>\n  hmac(sha256, k, secp.etc.concatBytes(...m));\nsecp.etc.hmacSha256Async = (k, ...m) =>\n  Promise.resolve(secp.etc.hmacSha256Sync(k, ...m));\n```\n\n## API Documentation\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query(request)`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create(request)`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_ (_optional_): tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write(request)`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read(request)`**\n\nMethod for reading a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete(request)`**\n\nMethod for deleting a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure(request)`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormats: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormats: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormats: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormats`** - _`Media Type string[]`_ (_optional_): Array of the IANA strings corresponding with the formats of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query(request)`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_ (_optional_): properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods ('ion'|'key'). The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.js","require":"./dist/cjs/main.js"}},"gitHead":"527e57a25e19229b482c06bdc1331879f34873e9","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"npm run clean && npm run build:esm && npm run build:cjs && npm run build:browser","clean":"rimraf dist tests/compiled","lint:fix":"eslint . --ext .ts --fix","build:cjs":"rimraf dist/cjs && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","build:esm":"rimraf dist/esm dist/types && npx tsc -p tsconfig.json","test:node":"rimraf tests/compiled && tsc -p tests/tsconfig.json && c8 mocha","test:browser":"karma start karma.conf.cjs","build:browser":"rimraf dist/browser.mjs dist/browser.js && node build/bundles.js"},"_npmUser":{"name":"frankhinek","email":"npmjs.291@identifier.email"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.8.1","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"18.17.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.1.9","@tbd54566975/crypto":"0.1.6","@tbd54566975/dwn-sdk-js":"0.1.0-unstable-2023-07-18-09-24-a78a613","@tbd54566975/web5-agent":"0.1.7","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.1.10","@tbd54566975/web5-proxy-agent":"0.1.7","@decentralized-identity/ion-tools":"1.1.1"},"react-native":"./dist/esm/main.js","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.1.6","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.7.11-alpha-20230728-527e57a_1690527541775_0.6245693179616021","host":"s3://npm-registry-packages"}},"0.8.0-alpha-20230728-70f8cf0":{"name":"@tbd54566975/web5","version":"0.8.0-alpha-20230728-70f8cf0","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.8.0-alpha-20230728-70f8cf0","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"8c2c717a6342f54146cadb70625e4b6007ab3ed8","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.8.0-alpha-20230728-70f8cf0.tgz","fileCount":58,"integrity":"sha512-+Ly1gl9XgDrx0hHgy3sWw2BFK1UsL0/bkyo93r2AeOMNscL0peWVpdLgSJJmojFM0bzB/BeDBoHDU4Tec5la5A==","signatures":[{"sig":"MEUCIQCMVWKoDwe22ekyoP0J3y/+2eHQQrwKxshEWe29Fz3zjAIgRH5YustHothPijkDi54Wx6hDv7lYVphvyNsoB61Bhy8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19511255},"main":"./dist/cjs/main.js","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.js","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n  - [Web5.connect](#web5connectoptions)\n  - [web5.dwn.records.query](#web5dwnrecordsqueryrequest)\n  - [web5.dwn.records.create](#web5dwnrecordscreaterequest)\n  - [web5.dwn.records.write](#web5dwnrecordswriterequest)\n  - [web5.dwn.records.read](#web5dwnrecordsreadrequest)\n  - [web5.dwn.records.delete](#web5dwnrecordsdeleterequest)\n  - [web5.dwn.protocols.configure](#web5dwnprotocolsconfigurerequest)\n  - [web5.dwn.protocols.query](#web5dwnprotocolsqueryrequest)\n  - [web5.did.create](#web5didcreatemethod-options)\n- [Project Resources](#project-resources)\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.11/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.11/dist/browser.mjs\n```\n\n## Usage\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### Additional Steps\n\nThis SDK relies indirectly on the [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519#usage)\nand [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1#usage) packages. Therefore,\nin certain environments, you'll need to perform additional steps to make it work.\n\n- Node.js <= 18\n\n```js\n// node.js 18 and earlier,  needs globalThis.crypto polyfill\nimport { webcrypto } from \"node:crypto\";\n// @ts-ignore\nif (!globalThis.crypto) globalThis.crypto = webcrypto;\n```\n\n- React Native:\n\n```js\n// If you're on react native. React Native needs crypto.getRandomValues polyfill and sha512\nimport \"react-native-get-random-values\";\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\ned.etc.sha512Sync = (...m) => sha512(ed.etc.concatBytes(...m));\ned.etc.sha512Async = (...m) => Promise.resolve(ed.etc.sha512Sync(...m));\n\nsecp.etc.hmacSha256Sync = (k, ...m) =>\n  hmac(sha256, k, secp.etc.concatBytes(...m));\nsecp.etc.hmacSha256Async = (k, ...m) =>\n  Promise.resolve(secp.etc.hmacSha256Sync(k, ...m));\n```\n\n## API Documentation\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query(request)`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create(request)`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_ (_optional_): tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write(request)`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read(request)`**\n\nMethod for reading a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete(request)`**\n\nMethod for deleting a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure(request)`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormats: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormats: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormats: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormats`** - _`Media Type string[]`_ (_optional_): Array of the IANA strings corresponding with the formats of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query(request)`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_ (_optional_): properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods ('ion'|'key'). The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.js","require":"./dist/cjs/main.js"}},"gitHead":"70f8cf0ac75b97395175d201b0ab48a4d8a3e484","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"npm run clean && npm run build:esm && npm run build:cjs && npm run build:browser","clean":"rimraf dist tests/compiled","lint:fix":"eslint . --ext .ts --fix","build:cjs":"rimraf dist/cjs && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","build:esm":"rimraf dist/esm dist/types && npx tsc -p tsconfig.json","test:node":"rimraf tests/compiled && tsc -p tests/tsconfig.json && c8 mocha","test:browser":"karma start karma.conf.cjs","build:browser":"rimraf dist/browser.mjs dist/browser.js && node build/bundles.js"},"_npmUser":{"name":"mistermoe","email":"m.jangda88@gmail.com"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"20.3.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.8.0-alpha-20230728-70f8cf0","@tbd54566975/crypto":"0.8.0-alpha-20230728-70f8cf0","@tbd54566975/dwn-sdk-js":"0.1.0-unstable-2023-07-18-09-24-a78a613","@tbd54566975/web5-agent":"0.8.0-alpha-20230728-70f8cf0","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.8.0-alpha-20230728-70f8cf0","@tbd54566975/web5-proxy-agent":"0.8.0-alpha-20230728-70f8cf0","@decentralized-identity/ion-tools":"1.1.1"},"react-native":"./dist/esm/main.js","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.1.6","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.8.0-alpha-20230728-70f8cf0_1690564136603_0.6597914091716781","host":"s3://npm-registry-packages"}},"0.8.0-alpha-20230728-d004f01":{"name":"@tbd54566975/web5","version":"0.8.0-alpha-20230728-d004f01","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.8.0-alpha-20230728-d004f01","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"46e912844c2c8929a6a65a9bf3ea5bd25d1e7243","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.8.0-alpha-20230728-d004f01.tgz","fileCount":58,"integrity":"sha512-R9Dob0cSBR/V8T4z1BfxOhBlAV3cEqvptkI5twfNskJuKk56KYtYRmbu8qEgrf4lT2PidbwuqiqmnkdTBMmm9g==","signatures":[{"sig":"MEQCIA2Imos1IAWeJJt6OsMzNT8yLpjMSm+vsJWMOxIhjGUSAiBn2rUsUZ7eM1kDW3SbECSiyNnYcKPR7F0jVMCp/uyVKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19204411},"main":"./dist/cjs/main.js","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.js","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n  - [Web5.connect](#web5connectoptions)\n  - [web5.dwn.records.query](#web5dwnrecordsqueryrequest)\n  - [web5.dwn.records.create](#web5dwnrecordscreaterequest)\n  - [web5.dwn.records.write](#web5dwnrecordswriterequest)\n  - [web5.dwn.records.read](#web5dwnrecordsreadrequest)\n  - [web5.dwn.records.delete](#web5dwnrecordsdeleterequest)\n  - [web5.dwn.protocols.configure](#web5dwnprotocolsconfigurerequest)\n  - [web5.dwn.protocols.query](#web5dwnprotocolsqueryrequest)\n  - [web5.did.create](#web5didcreatemethod-options)\n- [Project Resources](#project-resources)\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.11/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.11/dist/browser.mjs\n```\n\n## Usage\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### Additional Steps\n\nThis SDK relies indirectly on the [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519#usage)\nand [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1#usage) packages. Therefore,\nin certain environments, you'll need to perform additional steps to make it work.\n\n- Node.js <= 18\n\n```js\n// node.js 18 and earlier,  needs globalThis.crypto polyfill\nimport { webcrypto } from \"node:crypto\";\n// @ts-ignore\nif (!globalThis.crypto) globalThis.crypto = webcrypto;\n```\n\n- React Native:\n\n```js\n// If you're on react native. React Native needs crypto.getRandomValues polyfill and sha512\nimport \"react-native-get-random-values\";\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\ned.etc.sha512Sync = (...m) => sha512(ed.etc.concatBytes(...m));\ned.etc.sha512Async = (...m) => Promise.resolve(ed.etc.sha512Sync(...m));\n\nsecp.etc.hmacSha256Sync = (k, ...m) =>\n  hmac(sha256, k, secp.etc.concatBytes(...m));\nsecp.etc.hmacSha256Async = (k, ...m) =>\n  Promise.resolve(secp.etc.hmacSha256Sync(k, ...m));\n```\n\n## API Documentation\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query(request)`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create(request)`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_ (_optional_): tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write(request)`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read(request)`**\n\nMethod for reading a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete(request)`**\n\nMethod for deleting a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure(request)`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormats: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormats: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormats: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormats`** - _`Media Type string[]`_ (_optional_): Array of the IANA strings corresponding with the formats of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query(request)`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_ (_optional_): properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods ('ion'|'key'). The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.js","require":"./dist/cjs/main.js"}},"gitHead":"d004f017e769fb7fdbc74d0792c88f9e14ced677","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"npm run clean && npm run build:esm && npm run build:cjs && npm run build:browser","clean":"rimraf dist tests/compiled","lint:fix":"eslint . --ext .ts --fix","build:cjs":"rimraf dist/cjs && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","build:esm":"rimraf dist/esm dist/types && npx tsc -p tsconfig.json","test:node":"rimraf tests/compiled && tsc -p tests/tsconfig.json && c8 mocha","test:browser":"karma start karma.conf.cjs","build:browser":"rimraf dist/browser.mjs dist/browser.js && node build/bundles.js"},"_npmUser":{"name":"mistermoe","email":"m.jangda88@gmail.com"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"20.3.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.8.0-alpha-20230728-d004f01","@tbd54566975/crypto":"0.8.0-alpha-20230728-d004f01","@tbd54566975/dwn-sdk-js":"0.1.0-unstable-2023-07-18-09-24-a78a613","@tbd54566975/web5-agent":"0.8.0-alpha-20230728-d004f01","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.8.0-alpha-20230728-d004f01","@tbd54566975/web5-proxy-agent":"0.8.0-alpha-20230728-d004f01","@decentralized-identity/ion-tools":"1.1.1"},"react-native":"./dist/esm/main.js","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.1.6","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.8.0-alpha-20230728-d004f01_1690565073310_0.4009227217813558","host":"s3://npm-registry-packages"}},"0.8.0-alpha-20230728-88c49a2":{"name":"@tbd54566975/web5","version":"0.8.0-alpha-20230728-88c49a2","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.8.0-alpha-20230728-88c49a2","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"076e3b6d4a845c5325164b16f3e8821bcebbb3dd","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.8.0-alpha-20230728-88c49a2.tgz","fileCount":58,"integrity":"sha512-iRjGf44bpbhdwLgy0elMr9IPxyXTGTA59EueTIurOG6lv7VysNjNWOdP7IDJtdy27MuuaoRuL+sRQUUOrQpdIQ==","signatures":[{"sig":"MEUCIGtF6p9cNTbX4U2nF50SLK9oMm1/tm8DOcH1D78FZ+OTAiEAk918IdlqBx2XT3eyzLKxZm3EsMN8T33XeWUTIdYvrk4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19208025},"main":"./dist/cjs/main.js","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.js","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n  - [Web5.connect](#web5connectoptions)\n  - [web5.dwn.records.query](#web5dwnrecordsqueryrequest)\n  - [web5.dwn.records.create](#web5dwnrecordscreaterequest)\n  - [web5.dwn.records.write](#web5dwnrecordswriterequest)\n  - [web5.dwn.records.read](#web5dwnrecordsreadrequest)\n  - [web5.dwn.records.delete](#web5dwnrecordsdeleterequest)\n  - [web5.dwn.protocols.configure](#web5dwnprotocolsconfigurerequest)\n  - [web5.dwn.protocols.query](#web5dwnprotocolsqueryrequest)\n  - [web5.did.create](#web5didcreatemethod-options)\n- [Project Resources](#project-resources)\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.11/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.11/dist/browser.mjs\n```\n\n## Usage\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### Additional Steps\n\nThis SDK relies indirectly on the [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519#usage)\nand [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1#usage) packages. Therefore,\nin certain environments, you'll need to perform additional steps to make it work.\n\n- Node.js <= 18\n\n```js\n// node.js 18 and earlier,  needs globalThis.crypto polyfill\nimport { webcrypto } from \"node:crypto\";\n// @ts-ignore\nif (!globalThis.crypto) globalThis.crypto = webcrypto;\n```\n\n- React Native:\n\n```js\n// If you're on react native. React Native needs crypto.getRandomValues polyfill and sha512\nimport \"react-native-get-random-values\";\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\ned.etc.sha512Sync = (...m) => sha512(ed.etc.concatBytes(...m));\ned.etc.sha512Async = (...m) => Promise.resolve(ed.etc.sha512Sync(...m));\n\nsecp.etc.hmacSha256Sync = (k, ...m) =>\n  hmac(sha256, k, secp.etc.concatBytes(...m));\nsecp.etc.hmacSha256Async = (k, ...m) =>\n  Promise.resolve(secp.etc.hmacSha256Sync(k, ...m));\n```\n\n## API Documentation\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query(request)`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create(request)`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_ (_optional_): tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write(request)`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read(request)`**\n\nMethod for reading a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete(request)`**\n\nMethod for deleting a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure(request)`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormats: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormats: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormats: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormats`** - _`Media Type string[]`_ (_optional_): Array of the IANA strings corresponding with the formats of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query(request)`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_ (_optional_): properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods ('ion'|'key'). The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.js","require":"./dist/cjs/main.js"}},"gitHead":"88c49a2bea9a581b222cfce5bd54975a4b517035","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"npm run clean && npm run build:esm && npm run build:cjs && npm run build:browser","clean":"rimraf dist tests/compiled","lint:fix":"eslint . --ext .ts --fix","build:cjs":"rimraf dist/cjs && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","build:esm":"rimraf dist/esm dist/types && npx tsc -p tsconfig.json","test:node":"rimraf tests/compiled && tsc -p tests/tsconfig.json && c8 mocha","test:browser":"karma start karma.conf.cjs","build:browser":"rimraf dist/browser.mjs dist/browser.js && node build/bundles.js"},"_npmUser":{"name":"mistermoe","email":"m.jangda88@gmail.com"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"20.3.0","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.8.0-alpha-20230728-88c49a2","@tbd54566975/crypto":"0.8.0-alpha-20230728-88c49a2","@tbd54566975/dwn-sdk-js":"0.1.0-unstable-2023-07-18-09-24-a78a613","@tbd54566975/web5-agent":"0.8.0-alpha-20230728-88c49a2","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.8.0-alpha-20230728-88c49a2","@tbd54566975/web5-proxy-agent":"0.8.0-alpha-20230728-88c49a2","@decentralized-identity/ion-tools":"1.1.1"},"react-native":"./dist/esm/main.js","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.1.6","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.8.0-alpha-20230728-88c49a2_1690607912739_0.3644890342461613","host":"s3://npm-registry-packages"}},"0.8.0-alpha-20230728-c384773":{"name":"@tbd54566975/web5","version":"0.8.0-alpha-20230728-c384773","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"license":"Apache-2.0","_id":"@tbd54566975/web5@0.8.0-alpha-20230728-c384773","maintainers":[{"name":"kendallweihe","email":"kendallweihe@gmail.com"},{"name":"shamilovtim","email":"shamilovtim@gmail.com"},{"name":"frankhinek","email":"npmjs.291@identifier.email"},{"name":"michaelneale","email":"michael.neale@gmail.com"},{"name":"csuwildcat","email":"danieljb2@gmail.com"},{"name":"mistermoe","email":"m.jangda88@gmail.com"},{"name":"alrubinger","email":"alr@alrubinger.com"},{"name":"nitroneal","email":"nealr@squareup.com"},{"name":"mktbd","email":"mking@squareup.com"},{"name":"henrytsai","email":"henrytsai@outlook.com"}],"contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"dist":{"shasum":"e20d6f2b6ea5ccf5643d4e5a68655a2fd8e2fd01","tarball":"https://registry.npmjs.org/@tbd54566975/web5/-/web5-0.8.0-alpha-20230728-c384773.tgz","fileCount":58,"integrity":"sha512-RZHm10lfyGb2wJ32k1eGwsKus67HEUd9GGRQ1qR/mctcq8JnpmDY+C/OY1UUwRH8ehzcAJJyNcR8NuB1Fo8d3g==","signatures":[{"sig":"MEUCIDdODhERMba2k2GIfPqla3n0nTDpioO1RUZx+f2qDdvTAiEA0XLSmADiQcLm58VVNXglwiapm6GLAgvlX23DR13fspg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19222175},"main":"./dist/cjs/main.js","type":"module","types":"./dist/types/main.d.ts","module":"./dist/esm/main.js","readme":"# Web5 JS SDK\n\n[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)\n[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)\n[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)\n\nMaking developing with Web5 components at least 5 times easier to work with.\n\n> ⚠️ WEB5 JS SDK IS CURRENTLY IN TECH PREVIEW ⚠️\n\nThe SDK is currently still under active development, but having entered the Tech Preview phase there is now a drive to avoid unnecessary changes unless backwards compatibility is provided. Additional functionality will be added in the lead up to 1.0 final, and modifications will be made to address issues and community feedback.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n  - [Web5.connect](#web5connectoptions)\n  - [web5.dwn.records.query](#web5dwnrecordsqueryrequest)\n  - [web5.dwn.records.create](#web5dwnrecordscreaterequest)\n  - [web5.dwn.records.write](#web5dwnrecordswriterequest)\n  - [web5.dwn.records.read](#web5dwnrecordsreadrequest)\n  - [web5.dwn.records.delete](#web5dwnrecordsdeleterequest)\n  - [web5.dwn.protocols.configure](#web5dwnprotocolsconfigurerequest)\n  - [web5.dwn.protocols.query](#web5dwnprotocolsqueryrequest)\n  - [web5.did.create](#web5didcreatemethod-options)\n- [Project Resources](#project-resources)\n\n## Introduction\n\nWeb5 consists of the following components:\n\n- Decentralized Identifiers\n- Verifiable Credentials\n- DWeb Node personal datastores\n\nThe SDK sets out to gather the most oft used functionality from all three of these\npillar technologies to provide a simple library that is as close to effortless as\npossible.\n\n## Installation\n\n_NPM_\n\n```yaml\nnpm install @tbd54566975/web5\n```\n\n_CDNs_\n\n```yaml\nhttps://unpkg.com/@tbd54566975/web5@0.7.11/dist/browser.js\n```\n\n```yaml\nhttps://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.11/dist/browser.mjs\n```\n\n## Usage\n\n### Importing the SDK\n\n```javascript\nimport { Web5 } from \"@tbd54566975/web5\";\n```\n\nor\n\n```javascript\nimport { Web5 } from CDN_LINK_HERE;\n```\n\n### Additional Steps\n\nThis SDK relies indirectly on the [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519#usage)\nand [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1#usage) packages. Therefore,\nin certain environments, you'll need to perform additional steps to make it work.\n\n- Node.js <= 18\n\n```js\n// node.js 18 and earlier,  needs globalThis.crypto polyfill\nimport { webcrypto } from \"node:crypto\";\n// @ts-ignore\nif (!globalThis.crypto) globalThis.crypto = webcrypto;\n```\n\n- React Native:\n\n```js\n// If you're on react native. React Native needs crypto.getRandomValues polyfill and sha512\nimport \"react-native-get-random-values\";\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\ned.etc.sha512Sync = (...m) => sha512(ed.etc.concatBytes(...m));\ned.etc.sha512Async = (...m) => Promise.resolve(ed.etc.sha512Sync(...m));\n\nsecp.etc.hmacSha256Sync = (k, ...m) =>\n  hmac(sha256, k, secp.etc.concatBytes(...m));\nsecp.etc.hmacSha256Async = (k, ...m) =>\n  Promise.resolve(secp.etc.hmacSha256Sync(k, ...m));\n```\n\n## API Documentation\n\n### **`Web5.connect(options)`**\n\nEnables an app to request connection to a user's local identity app (like a desktop or mobile agent - work is underway for reference apps of each), or generate an in-app DID to represent the user (e.g. if the user does not have an identity app).\n\n> **NOTE:** The outputs of this method invocation will be used throughout the other API methods below.\n\n```javascript\nconst { web5, did: myDid } = await Web5.connect();\n```\n\n#### **`options`** _(optional)_\n\nAn object which may specify any of the following properties:\n\n- **`techPreview`** - _`object`_ _(optional)_: an object that specifies configuration parameters that are relevant during the Tech Preview period of Web5 JS and may be deprecated in the future with advance notice.\n\n  - **`dwnEndpoints`** - _`array`_ _(optional)_: a list of DWeb Node endpoints to define in the DID created and returned by `Web5.connect()`. If this property is omitted, during the Tech Preview two nodes will be included by default (e.g., `['https://dwn.tbddev.org/dwn0', 'https://dwn.tbddev.org/dwn3']`).\n\n  For example:\n\n  ```typescript\n  const { web5, did: myDid } = await Web5.connect({\n    techPreview: {\n      dwnEndpoints: [\"https://dwn.your-domain.org/\"],\n    },\n  });\n  ```\n\n<!-- > NOTE: This method **_MUST_** be invoked within the scope of a 'trusted user action' (something enforced by the OS/browser) if the desire is to connect to a local identity app. For browsers this is generally some direct user action, like clicking a link or button. -->\n\n#### **Response**\n\nAn invocation of `Web5.connect()` produces the following items in response:\n\n- **`web5`** - _`Web5 instance`_: A class instance that enables access to a locally running DWeb Node, DID interaction methods, and other capabilities related to the connected DID.\n- **`did`** - _`string`_: The DID that was created or attained connection to.\n\n### **`Record` instances from responses**\n\nEvery modifying method (`create`, `write`, etc.) and the `entries` from queries return an instance of a `Record` class, which is a representation of the Record(s) being referenced.\n\nEach `Record` instance has the following instance properties: `id`, `attestation`, `contextId`, `dataFormat`, `dateCreated`, `encryption`, `interface`, `method`, `parentId`, `protocol`, `protocolPath`, `recipient`, `schema`, `dataCid`, `dataSize`, `dateModified`, `datePublished`, and `published`.\n\n> **Note** The **`id`** property is a unique identifier based on the record entry's composition. All entries across all records are deterministically unique.\n\nEach `Record` instance has the following instance methods:\n\n- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:\n  - **`text`** - _`function`_: produces a textual representation of the data.\n  - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.\n  - **`stream`** - _`function`_: returns the raw stream of bytes for the data.\n- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.\n- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.\n- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.\n\n### **`web5.dwn.records.query(request)`**\n\nMethod for querying either the locally connected DWeb Node or any remote DWeb Node specified in the `from` property.\n\n```javascript\n// This invocation will query the user's own DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  message: {\n    filter: {\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n\n// This invocation will query Bob's DWeb Nodes\nconst { records } = await web5.dwn.records.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n      schema: \"https://schema.org/Playlist\",\n      dataFormat: \"application/json\",\n    },\n  },\n});\n\nconsole.log(records); // an array of record entries from Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe query `request` contains the following properties:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: the properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_: properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n    - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query.\n    - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.create(request)`**\n\nMethod for creating a new record and storing it in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// this creates a record and stores it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  data: \"Hello World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconsole.log(await record.data.text()); // logs \"Hello World!\"\nconst { status } = await record.send(myDid); // send the record to the user's remote DWeb Nodes\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n\n// this creates a record, but does not store it in the user's local DWeb Node\nconst { record } = await web5.dwn.records.create({\n  store: false,\n  data: \"Hello again, World!\",\n  message: {\n    dataFormat: \"text/plain\",\n  },\n});\n\nconst { status } = await record.send(\"did:example:bob\"); // send the newly generated record to Bob's DWeb Nodes\n```\n\n#### **Request**\n\nThe `create` request object is composed as follows:\n\n- **`store`** - _`boolean`_ (_optional_): tells the create function whether or not to store the record in the user's local DWeb Node. (you might pass `false` if you didn't want to retain a copy of the record for yourself)\n- **`data`** - _`text|object|file|blob`_: the data payload of the record.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol under which the record will be bucketed.\n  - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n  - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n\n### **`web5.dwn.records.write(request)`**\n\nThe `create()` method is an alias for `write()` and both can take the same request object properties.\n\n### **`web5.dwn.records.read(request)`**\n\nMethod for reading a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Reads the indicated record from the user's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n\n// Reads the indicated record from Bob's DWeb Nodes\nconst { record } = await web5.dwn.records.read({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\nconsole.log(await record.data.text()); // assuming the record is a text payload, logs the text\n```\n\n#### **Request**\n\nThe `read` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the read request will fetch the indicated record from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record data you are fetching.\n\n### **`web5.dwn.records.delete(request)`**\n\nMethod for deleting a record stored in the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\n// Deletes the indicated record from the user's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n\n// Deletes the indicated record from Bob's DWeb Node\nconst { record } = await web5.dwn.records.delete({\n  from: \"did:example:bob\",\n  message: {\n    recordId: \"bfw35evr6e54c4cqa4c589h4cq3v7w4nc534c9w7h5\",\n  },\n});\n```\n\n#### **Request**\n\nThe `delete` request object is composed as follows:\n\n- **`from`** - _`DID string`_ (_optional_): The DID of the DWeb Node the delete tombstone will be sent to.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`recordId`** - _`string`_: the required record ID string that identifies the record being deleted.\n\n### **`web5.dwn.protocols.configure(request)`**\n\nMethod for configuring a protocol definition in the DWeb Node of the user's local DWeb Node, remote DWeb Nodes, or another party's DWeb Nodes (if permitted).\n\n```javascript\nconst { protocol } = await web5.dwn.protocols.configure({\n  message: {\n    definition: {\n      protocol: \"https://photos.org/protocol\",\n      types: {\n        album: {\n          schema: \"https://photos.org/protocol/album\",\n          dataFormats: [\"application/json\"],\n        },\n        photo: {\n          schema: \"https://photos.org/protocols/photo\",\n          dataFormats: [\"application/json\"],\n        },\n        binaryImage: {\n          dataFormats: [\"image/png\", \"jpeg\", \"gif\"],\n        },\n      },\n      structure: {\n        album: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n        },\n        photo: {\n          $actions: [\n            {\n              who: \"recipient\",\n              can: \"read\",\n            },\n          ],\n          binaryImage: {\n            $actions: [\n              {\n                who: \"author\",\n                of: \"photo\",\n                can: \"write\",\n              },\n            ],\n          },\n        },\n      },\n    },\n  },\n});\n\nprotocol.send(myDid); // sends the protocol configuration to the user's other DWeb Nodes.\n```\n\n#### **Request**\n\nThe `configure` request object is composed as follows:\n\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid DWeb Node message.\n  - **`definition`** - _`object`_: an object that defines the enforced composition of the protocol.\n    - **`protocol`** - _`URI string`_: a URI that represents the protocol being configured.\n    - **`types`** - _`object`_: an object that defines the records that can be used in the `structure` graph of the `definition` object. The following properties are optional constraints you can set for the type being defined:\n      - **`schema`** - _`URI string`_ (_optional_): the URI of the schema under which the record will be bucketed.\n      - **`dataFormats`** - _`Media Type string[]`_ (_optional_): Array of the IANA strings corresponding with the formats of the data the record will be bucketed. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml\n    - **`structure`** - _`object`_: an object that defines the structure of a protocol, including data relationships and constraints on which entities can perform various activities. Fields under the `structure` object of the Protocol definition are expected to be either type references matching those defined in the `types` object. The type structures are recursive, so types form a graph and each type can have within it further attached types or the following rule statements that are all denoted with the prefix `$`:\n      - **`$actions`** - _`array`_: one or more rule objects that expose various allowed actions to actors (`author`, `recipient`), composed as follows:\n        - **`who`** - _`string`_: the actor (`author`, `recipient`) that is being permitted to invoke a given action.\n        - **`of`** - _`string`_: the protocol path that refers to the record subject. Using the above example protocol, the protocol path to `binaryImage` would be `photo/binaryImage`.\n        - **`can`** - _`string`_: the action being permitted by the rule.\n\n### **`web5.dwn.protocols.query(request)`**\n\nMethod for querying a DID's DWeb Nodes for the presence of a protocol. This method is useful in detecting what protocols a given DID has installed to enable interaction over the protocol.\n\n```javascript\nconst { protocols } = await web5.dwn.protocols.query({\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on the user's own DWeb Node\n\nconst { protocols } = await web5.dwn.protocols.query({\n  from: \"did:example:bob\",\n  message: {\n    filter: {\n      protocol: \"https://music.org/protocol\",\n    },\n  },\n});\n\nconsole.log(protocols); // logs an array of protocol configurations installed on Bob's DWeb Node\n```\n\n#### **Request**\n\nThe query `request` must contain the following:\n\n- **`from`** - _`DID string`_ (_optional_): the decentralized identifier of the DWeb Node the query will fetch results from.\n- **`message`** - _`object`_: The properties of the DWeb Node Message Descriptor that will be used to construct a valid record query:\n  - **`filter`** - _`object`_ (_optional_): properties against which results of the query will be filtered:\n    - **`protocol`** - _`URI string`_ (_optional_): the URI of the protocol bucket in which to query.\n\n### **`web5.did.create(method, options)`**\n\nThe `create` method under the `did` object enables generation of DIDs for a supported set of DID Methods ('ion'|'key'). The output is method-specific, and handles things like key generation and assembly of DID Documents that can be published to DID networks.\n\n> NOTE: You do not usually need to manually invoke this, as the `Web5.connect()` method already acquires a DID for the user (either by direct creation or connection to an identity agent app).\n\n```javascript\nconst myDid = await Web5.did.create(\"ion\");\n```\n\n## Project Resources\n\n| Resource                                                                                  | Description                                                                   |\n| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [CODEOWNERS](https://github.com/TBD54566975/web5-js/blob/main/CODEOWNERS)                 | Outlines the project lead(s)                                                  |\n| [CODE_OF_CONDUCT.md](https://github.com/TBD54566975/web5-js/blob/main/CODE_OF_CONDUCT.md) | Expected behavior for project contributors, promoting a welcoming environment |\n| [CONTRIBUTING.md](https://github.com/TBD54566975/web5-js/blob/main/CONTRIBUTING.md)       | Developer guide to build, test, run, access CI, chat, discuss, file issues    |\n| [GOVERNANCE.md](https://github.com/TBD54566975/web5-js/blob/main/GOVERNANCE.md)           | Project governance                                                            |\n| [LICENSE](./LICENSE)                                                                      | Apache License, Version 2.0                                                   |\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/main.d.ts","import":"./dist/esm/main.js","require":"./dist/cjs/main.js"}},"gitHead":"c384773b44ba502c25345657d2b501e0a36cb264","scripts":{"lint":"eslint . --ext .ts --max-warnings 0","build":"npm run clean && npm run build:esm && npm run build:cjs && npm run build:browser","clean":"rimraf dist tests/compiled","lint:fix":"eslint . --ext .ts --fix","build:cjs":"rimraf dist/cjs && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","build:esm":"rimraf dist/esm dist/types && npx tsc -p tsconfig.json","test:node":"rimraf tests/compiled && tsc -p tests/tsconfig.json && c8 mocha","test:browser":"karma start karma.conf.cjs","build:browser":"rimraf dist/browser.mjs dist/browser.js && node build/bundles.js"},"_npmUser":{"name":"mistermoe","email":"m.jangda88@gmail.com"},"deprecated":"Package no longer supported. Update to @web5/api.","repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"_npmVersion":"9.6.7","description":"SDK for accessing the features and capabilities of Web5","directories":{},"_nodeVersion":"20.3.1","dependencies":{"ms":"2.1.3","level":"8.0.0","@tbd54566975/dids":"0.8.0-alpha-20230728-c384773","@tbd54566975/crypto":"0.8.0-alpha-20230728-c384773","@tbd54566975/dwn-sdk-js":"0.1.0-unstable-2023-07-18-09-24-a78a613","@tbd54566975/web5-agent":"0.8.0-alpha-20230728-c384773","readable-web-to-node-stream":"3.0.2","@tbd54566975/web5-user-agent":"0.8.0-alpha-20230728-c384773","@tbd54566975/web5-proxy-agent":"0.8.0-alpha-20230728-c384773","@decentralized-identity/ion-tools":"1.1.1"},"react-native":"./dist/esm/main.js","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"8.0.0","chai":"4.3.7","karma":"6.4.1","mocha":"10.2.0","sinon":"15.0.2","eslint":"8.39.0","rimraf":"4.4.0","esbuild":"0.16.17","@types/ms":"0.7.31","karma-chai":"0.1.0","typescript":"5.1.6","@types/chai":"4.3.0","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","@types/eslint":"8.37.0","karma-esbuild":"2.2.5","@playwright/test":"1.34.3","chai-as-promised":"7.1.1","source-map-loader":"4.0.1","eslint-plugin-mocha":"10.1.0","node-stdlib-browser":"1.2.0","karma-mocha-reporter":"2.2.5","karma-chrome-launcher":"3.1.1","karma-webkit-launcher":"2.1.0","@types/readable-stream":"2.3.15","karma-firefox-launcher":"2.1.2","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.0","@typescript-eslint/eslint-plugin":"5.59.0"},"_npmOperationalInternal":{"tmp":"tmp/web5_0.8.0-alpha-20230728-c384773_1690901382909_0.3395470700134857","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-03-07T20:43:32.748Z","modified":"2024-12-04T19:44:58.438Z","0.0.1-unstable.2b1701e-2023.3.07-20-43-27":"2023-03-07T20:43:33.169Z","0.0.1-unstable.389755f-2023.3.07-22-58-58":"2023-03-07T22:59:03.749Z","0.0.1-unstable.a8cbc6d-2023.3.08-14-00-47":"2023-03-08T14:00:52.325Z","0.0.1-unstable.b9f8d3c-2023.3.09-20-02-51":"2023-03-09T20:02:56.727Z","0.0.1-unstable.efe17b7-2023.3.10-00-21-36":"2023-03-10T00:21:43.020Z","0.0.1-unstable.a530a17-2023.3.10-02-08-09":"2023-03-10T02:08:14.370Z","0.0.1-unstable.78e6bd7-2023.3.10-14-31-00":"2023-03-10T14:31:06.110Z","0.0.1-unstable.d594a25-2023.3.13-21-14-34":"2023-03-13T21:14:44.009Z","0.0.1-unstable.d594a25-2023.3.16-03-06-55":"2023-03-16T03:07:04.210Z","0.1.0-unstable.9582961-2023.3.16-03-23-32":"2023-03-16T03:23:41.851Z","0.2.0-unstable.03d4273-2023.3.17-04-09-58":"2023-03-17T04:10:07.138Z","0.3.0-unstable.f314cd1-2023.3.21-18-36-30":"2023-03-21T18:36:40.396Z","0.3.0":"2023-03-21T18:49:15.140Z","0.3.1":"2023-03-21T18:53:23.362Z","0.3.1-unstable.e2dfe57-2023.3.23-19-07-37":"2023-03-23T19:07:46.565Z","0.3.1-unstable.3fc6eb2-2023.3.29-16-51-06":"2023-03-29T16:51:15.637Z","0.3.1-unstable.bd764a1-2023.3.29-18-44-39":"2023-03-29T18:44:57.486Z","0.4.0-unstable.e6470ce-2023.4.01-19-39-11":"2023-04-01T19:39:21.333Z","0.4.0-unstable.6006d92-2023.4.05-19-13-42":"2023-04-05T19:13:52.573Z","0.4.0-unstable.bb8a252-2023.4.06-03-16-57":"2023-04-06T03:17:07.158Z","0.5.0-unstable.0e142f8-2023.4.14-14-47-36":"2023-04-14T14:47:46.731Z","0.5.0-unstable.786f182-2023.4.14-19-49-40":"2023-04-14T19:49:50.614Z","0.4.0":"2023-04-14T20:54:09.586Z","0.5.0-unstable.a7b0e83-2023.4.15-00-29-09":"2023-04-15T00:29:19.677Z","0.6.0-unstable.3e81ed1-2023.4.21-15-46-46":"2023-04-21T15:46:57.204Z","0.6.0":"2023-04-21T15:54:07.887Z","0.6.0-unstable.ee0107c-2023.4.23-12-44-57":"2023-04-23T12:45:06.396Z","0.6.0-unstable.0e368cf-2023.4.25-18-15-55":"2023-04-25T18:16:05.423Z","0.6.0-unstable.d5caeaf-2023.4.25-18-18-08":"2023-04-25T18:18:20.280Z","0.6.1-unstable.8300edf-2023.4.29-13-08-15":"2023-04-29T13:08:25.761Z","0.6.1-unstable.f3867c0-2023.4.29-21-05-26":"2023-04-29T21:05:37.952Z","0.6.2-unstable.13e31e1-2023.4.29-21-13-29":"2023-04-29T21:13:39.104Z","0.6.2":"2023-04-29T21:14:13.668Z","0.6.2-unstable.c20647a-2023.5.02-21-01-31":"2023-05-02T21:01:47.718Z","0.6.3-unstable.467987f-2023.5.03-21-51-21":"2023-05-03T21:51:31.547Z","0.6.3":"2023-05-03T21:53:27.425Z","0.7.0-alpha-20230512-fb6a55d":"2023-05-12T23:27:57.114Z","0.7.0":"2023-05-16T17:12:39.178Z","0.7.1":"2023-05-18T12:51:12.336Z","0.7.2":"2023-05-18T15:57:05.946Z","0.7.3":"2023-05-19T18:07:29.105Z","0.7.4":"2023-05-20T15:14:39.848Z","0.7.5":"2023-05-23T06:48:30.735Z","0.7.6":"2023-06-01T19:18:27.742Z","0.7.7":"2023-06-02T22:49:08.983Z","0.7.8":"2023-06-07T02:05:14.792Z","0.7.8-alpha-20230608-49f8e7b":"2023-06-08T13:10:00.753Z","0.7.9":"2023-06-13T01:03:37.041Z","0.7.9-alpha-20230622-5d57e26":"2023-06-22T17:13:41.261Z","0.7.9-alpha-20230623-69ab8a5":"2023-06-23T19:13:35.101Z","0.7.10":"2023-06-27T02:42:21.736Z","0.7.11":"2023-07-07T16:42:54.710Z","0.7.11-alpha-20230713-d1dda95":"2023-07-13T03:01:21.174Z","0.7.11-alpha-20230713-3f5d2c2":"2023-07-13T04:02:46.435Z","0.7.11-alpha-20230728-c6d0363":"2023-07-28T06:18:59.270Z","0.7.11-alpha-20230728-527e57a":"2023-07-28T06:59:02.116Z","0.8.0-alpha-20230728-70f8cf0":"2023-07-28T17:08:56.907Z","0.8.0-alpha-20230728-d004f01":"2023-07-28T17:24:33.528Z","0.8.0-alpha-20230728-88c49a2":"2023-07-29T05:18:33.017Z","0.8.0-alpha-20230728-c384773":"2023-08-01T14:49:43.238Z"},"bugs":{"url":"https://github.com/TBD54566975/web5-js/issues"},"license":"Apache-2.0","homepage":"https://github.com/TBD54566975/web5-js/tree/main/packages/web5#readme","keywords":["decentralized","decentralized-applications","decentralized-identity","decentralized-web","DID","sdk","verifiable-credentials","web5","web5-sdk"],"repository":{"url":"git+https://github.com/TBD54566975/web5-js.git","type":"git","directory":"packages/web5"},"description":"SDK for accessing the features and capabilities of Web5","contributors":[{"url":"https://github.com/csuwildcat","name":"Daniel Buchner"},{"url":"https://github.com/frankhinek","name":"Frank Hinek"},{"url":"https://github.com/mistermoe","name":"Moe Jangda"}],"maintainers":[{"email":"releases@tbd.email","name":"tbd-releases"},{"email":"oss-releases@block.xyz","name":"block-oss-releases"}],"readme":"","readmeFilename":""}