* lexicon for did doc w/ auth credentials * include did doc w/ session when configured. configure on dev-env. * Add dynamic PDS URL adoption to the client * remove usage of did doc field from getsession in client * dry-up did doc type and validation * remove explicit dep on zod by identity package * move more did doc parsing to common-web * go back to strings * rollback breaking changes to identity package * add changeset --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: dholms <dtholmgren@gmail.com>
@atproto/identity
TypeScript library for decentralized identities in atproto using DIDs and handles
Example
Resolving a Handle and verifying against DID document:
const didres = new DidResolver({})
const hdlres = new HandleResolver({})
const handle = 'atproto.com'
const did = await hdlres.resolve(handle)
if (did == undefined) {
throw new Error('expected handle to resolve')
}
console.log(did) // did:plc:ewvi7nxzyoun6zhxrhs64oiz
const doc = await didres.resolve(did)
console.log(doc)
// additional resolutions of same DID will be cached for some time, unless forceRefresh flag is used
const doc2 = await didres.resolve(did, true)
// helper methods use the same cache
const data = await didres.resolveAtprotoData(did)
if (data.handle != handle) {
throw new Error('invalid handle (did not match DID document)')
}
License
MIT License