Fork of github.com/did-method-plc/did-method-plc

packages: README and package metadata update (#48)

* lib: update README

* server: update README

* update package.json metadata

Changed files
+87 -4
packages
+50 -1
packages/lib/README.md
···
-
# DID PLC Library
+
+
@did-plc/lib - DID PLC Typescript Client Library
+
================================================
+
+
[![NPM](https://img.shields.io/npm/v/@did-plc/lib)](https://www.npmjs.com/package/@did-plc/lib)
+
[![Github CI Status](https://github.com/bluesky-social/did-method-plc/actions/workflows/repo.yaml/badge.svg)](https://github.com/bluesky-social/did-method-plc/actions/workflows/repo.yaml)
+
+
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).
+
+
## Client Usage
+
+
Fetching account data from directory:
+
+
```typescript
+
import * as plc from '@did-plc/lib'
+
+
client = new plc.Client('https://plc.directory')
+
+
let exampleDid = 'did:plc:yk4dd2qkboz2yv6tpubpc6co'
+
+
// current account data, in terse object format
+
const data = await client.getDocumentData(exampleDid)
+
+
// or, the full DID Document
+
const didDoc = await client.getDocument(exampleDid)
+
```
+
+
Registering a new DID PLC:
+
+
```typescript
+
import { Secp256k1Keypair } from '@atproto/crypto'
+
import * as plc from '@did-plc/lib'
+
+
// please test against a sandbox or local development server
+
client = new plc.Client('http://localhost:2582')
+
+
let signingKey = await Secp256k1Keypair.create()
+
let rotationKey = await Secp256k1Keypair.create()
+
+
did = await client.createDid({
+
signingKey: signingKey.did(),
+
handle: 'handle.example.com',
+
pds: 'https://pds.example.com',
+
rotationKeys: [rotationKey.did()],
+
signer: rotationKey,
+
})
+
```
+
## License
+
+
MIT / Apache 2.0 dual-licensed.
+13 -1
packages/lib/package.json
···
{
"name": "@did-plc/lib",
"version": "0.0.4",
-
"main": "dist/index.js",
"license": "MIT",
+
"description": "DID PLC Typescript Client Library",
+
"keywords": [
+
"did-plc",
+
"did",
+
"atproto"
+
],
+
"homepage": "https://web.plc.directory",
+
"repository": {
+
"type": "git",
+
"url": "https://github.com/bluesky-social/did-method-plc",
+
"directory": "packages/lib"
+
},
+
"main": "dist/index.js",
"scripts": {
"test": "jest",
"prettier": "prettier --check src/",
+11 -1
packages/server/README.md
···
-
# DID PLC Server
+
+
@did-plc/server - DID PLC Directory Service
+
===========================================
+
+
Reference implementation of the PLC DID method, in Typescript.
+
+
This is the software that runs the <https://plc.directory> service.
+
+
## License
+
+
MIT / Apache 2.0 dual-licensed.
+13 -1
packages/server/package.json
···
{
"name": "@did-plc/server",
"version": "0.0.1",
-
"main": "dist/index.js",
"license": "MIT",
+
"description": "DID PLC Directory Service",
+
"keywords": [
+
"did-plc",
+
"did",
+
"atproto"
+
],
+
"homepage": "https://web.plc.directory",
+
"repository": {
+
"type": "git",
+
"url": "https://github.com/bluesky-social/did-method-plc",
+
"directory": "packages/server"
+
},
+
"main": "dist/index.js",
"scripts": {
"start": "node dist/bin.js",
"test": "./pg/with-test-db.sh jest",