0.4.8 • Published 6 months ago
@atproto/identity v0.4.8
@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
This project is dual-licensed under MIT and Apache 2.0 terms:
- MIT license (LICENSE-MIT.txt or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0, (LICENSE-APACHE.txt or http://www.apache.org/licenses/LICENSE-2.0)
Downstream 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.
0.4.8
6 months ago
0.4.5
10 months ago
0.4.4
10 months ago
0.4.7
7 months ago
0.4.6
9 months ago
0.4.3
12 months ago
0.4.2
1 year ago
0.4.1
1 year ago
0.4.0
2 years ago
0.3.3
2 years ago
0.3.3-next.0
2 years ago
0.3.2
2 years ago
0.3.0
2 years ago
0.3.1
2 years ago
0.1.0
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago
0.0.1
2 years ago