{"_id":"@bluesky-social/lexicon-resolver","name":"@bluesky-social/lexicon-resolver","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.2":{"name":"@bluesky-social/lexicon-resolver","version":"0.2.2","type":"commonjs","license":"MIT","description":"ATProto Lexicon resolution","keywords":["atproto","lexicon"],"homepage":"https://atproto.com","repository":{"type":"git","url":"git+https://github.com/bluesky-social/atproto.git","directory":"packages/lexicon-resolver"},"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"dependencies":{"multiformats":"^9.9.0","@atproto-labs/fetch-node":"^0.1.10","@bluesky-social/identity":"^0.4.9","@bluesky-social/lexicon":"^0.5.1","@bluesky-social/repo":"^0.8.10","@bluesky-social/syntax":"^0.4.1","@bluesky-social/xrpc":"^0.7.5"},"devDependencies":{"jest":"^28.1.3","typescript":"^5.9.3","@bluesky-social/common":"^0.4.12","@bluesky-social/lex-cli":"^0.9.5"},"scripts":{"test":"jest","build":"tsc --build tsconfig.build.json","codegen":"lex gen-api --yes ./src/client ../../lexicons/com/atproto/sync/getRecord.json"},"_id":"@bluesky-social/lexicon-resolver@0.2.2","bugs":{"url":"https://github.com/bluesky-social/atproto/issues"},"_integrity":"sha512-ehm2mydptrWczypTX+MqgrP/9Cy4ppEg7Zk8+Ukj+AxT+d4xw1lbX/TuTBmN3no6PGZuFa/WiQEB3rRKFUg6zw==","_resolved":"/private/var/folders/cb/7sst87dj7jd40nc7b7q7h76r0000gn/T/7d5fbe8ee1cc8d25da2d6c9e33ca07ee/bluesky-social-lexicon-resolver-0.2.2.tgz","_from":"file:bluesky-social-lexicon-resolver-0.2.2.tgz","_nodeVersion":"20.15.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-ehm2mydptrWczypTX+MqgrP/9Cy4ppEg7Zk8+Ukj+AxT+d4xw1lbX/TuTBmN3no6PGZuFa/WiQEB3rRKFUg6zw==","shasum":"7c9e301ee8eaa8d99ce1b3faa1d7ecd26d02c0e2","tarball":"https://registry.npmjs.org/@bluesky-social/lexicon-resolver/-/lexicon-resolver-0.2.2.tgz","fileCount":51,"unpackedSize":110627,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC10TRjUwtiDlTDIgWuHFSPhsiXGAzr4NkT3Sl+ItdI4gIhAI/1zix+BV7x1LScnFT07+XxqGS/NWRSlzMAFSqXIHWm"}]},"_npmUser":{"name":"web3km","email":"web3km@proton.me"},"directories":{},"maintainers":[{"name":"openweb3.io","email":"mtsocialdao@gmail.com"},{"name":"web3km","email":"web3km@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lexicon-resolver_0.2.2_1761039226157_0.00896446713521537"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-21T09:33:46.048Z","0.2.2":"2025-10-21T09:33:46.348Z","modified":"2025-10-21T09:33:46.669Z"},"maintainers":[{"name":"openweb3.io","email":"mtsocialdao@gmail.com"},{"name":"web3km","email":"web3km@proton.me"}],"description":"ATProto Lexicon resolution","homepage":"https://atproto.com","keywords":["atproto","lexicon"],"repository":{"type":"git","url":"git+https://github.com/bluesky-social/atproto.git","directory":"packages/lexicon-resolver"},"bugs":{"url":"https://github.com/bluesky-social/atproto/issues"},"license":"MIT","readme":"# @bluesky-social/lexicon-resolver\n\nATProto Lexicon resolution\n\n[![NPM](https://img.shields.io/npm/v/@bluesky-social/lexicon-resolver)](https://www.npmjs.com/package/@bluesky-social/lexicon-resolver)\n[![Github CI Status](https://github.com/bluesky-social/atproto/actions/workflows/repo.yaml/badge.svg)](https://github.com/bluesky-social/atproto/actions/workflows/repo.yaml)\n\n## Usage\n\nThis package may be used to determine the DID authority for a Lexicon based on its NSID, and to resolve a Lexicon from its NSID based on [Lexicon Resolution](https://atproto.com/specs/lexicon#lexicon-publication-and-resolution) from the network. Resolutions always verify the inclusion proof for the Lexicon schema document published to the ATProto network.\n\n```ts\nimport {\n  resolveLexicon,\n  resolveLexiconDidAuthority,\n} from '@bluesky-social/lexicon-resolver'\n\n// Which DID is the authority over this Lexicon?\nconst didAuthority = await resolveLexiconDidAuthority('app.bsky.feed.post')\n// Resolve the Lexicon document with resolution details\nconst resolved = await resolveLexicon('app.bsky.feed.post')\n/**\n * {\n *   commit: {\n *     did: 'did:plc:4v4y5r3lwsbtmsxhile2ljac',\n *     rev: '3lnlpukgipj2c',\n *     sig: Uint8Array(64),\n *     ...\n *   },\n *   uri: AtUri(at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.post),\n *   cid: CID(bafyreidgbehqwweghrrddfu6jgj7lyr6fwhzgazhirnszdb5lvr7iynkiy),\n *   nsid: NSID('app.bsky.feed.post'),\n *   lexicon: {\n *     '$type': 'com.atproto.lexicon.schema',\n *     lexicon: 1\n *     id: 'app.bsky.feed.post',\n *     defs: { main: [Object], ... },\n *   }\n * }\n */\n```\n\n### With identity caching\n\nIdentity data is used in order to fetch and verify record contents. The @bluesky-social/identity package can be used to offer more control over caching and other behaviors of identity lookups.\n\n```ts\nimport { IdResolver, MemoryCache } from '@bluesky-social/identity'\nimport { buildLexiconResolver } from '@bluesky-social/lexicon-resolver'\n\nconst resolveLexicon = buildLexiconResolver({\n  idResolver: new IdResolver({\n    didCache: new MemoryCache(),\n  }),\n})\n\nconst resolved = await resolveLexicon('app.bsky.feed.post')\n```\n\n### With DID authority override\n\nYou may specify a specific DID authority you'd like to use to perform a Lexicon resolution, overriding ATProto's DNS-based authority over Lexicons. This is described in some more detail in [Authority and Control](https://atproto.com/specs/lexicon#authority-and-control).\n\n```ts\nimport { resolveLexicon } from '@bluesky-social/lexicon-resolver'\n\nconst resolved = await resolveLexicon('app.bsky.feed.post', {\n  didAuthority: 'did:plc:...',\n})\n```\n\n## License\n\nThis project is dual-licensed under MIT and Apache 2.0 terms:\n\n- MIT license ([LICENSE-MIT.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-MIT.txt) or http://opensource.org/licenses/MIT)\n- Apache License, Version 2.0, ([LICENSE-APACHE.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-APACHE.txt) or http://www.apache.org/licenses/LICENSE-2.0)\n\nDownstream projects and end users may chose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.\n","readmeFilename":"README.md","_rev":"1-6d77ca906dc1c8f6fee3538be0645f49"}