···11-# DID PLC Library
11+22+@did-plc/lib - DID PLC Typescript Client Library
33+================================================
44+55+[](https://www.npmjs.com/package/@did-plc/lib)
66+[](https://github.com/bluesky-social/did-method-plc/actions/workflows/repo.yaml)
77+88+This library provides both a simple client for the PLC directory, and an implementation of the PLC method itself (using a cryptographically signed operation log).
99+1010+## Client Usage
1111+1212+Fetching account data from directory:
1313+1414+```typescript
1515+import * as plc from '@did-plc/lib'
1616+1717+client = new plc.Client('https://plc.directory')
1818+1919+let exampleDid = 'did:plc:yk4dd2qkboz2yv6tpubpc6co'
2020+2121+// current account data, in terse object format
2222+const data = await client.getDocumentData(exampleDid)
2323+2424+// or, the full DID Document
2525+const didDoc = await client.getDocument(exampleDid)
2626+```
2727+2828+Registering a new DID PLC:
2929+3030+```typescript
3131+import { Secp256k1Keypair } from '@atproto/crypto'
3232+import * as plc from '@did-plc/lib'
3333+3434+// please test against a sandbox or local development server
3535+client = new plc.Client('http://localhost:2582')
3636+3737+let signingKey = await Secp256k1Keypair.create()
3838+let rotationKey = await Secp256k1Keypair.create()
3939+4040+did = await client.createDid({
4141+ signingKey: signingKey.did(),
4242+ handle: 'handle.example.com',
4343+ pds: 'https://pds.example.com',
4444+ rotationKeys: [rotationKey.did()],
4545+ signer: rotationKey,
4646+})
4747+```
2484949+## License
5050+5151+MIT / Apache 2.0 dual-licensed.
···11-# DID PLC Server
11+22+@did-plc/server - DID PLC Directory Service
33+===========================================
44+55+Reference implementation of the PLC DID method, in Typescript.
66+77+This is the software that runs the <https://plc.directory> service.
88+99+## License
1010+1111+MIT / Apache 2.0 dual-licensed.