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

Configure Feed

Select the types of activity you want to include in your feed.

packages: README and package metadata update (#48)

* lib: update README

* server: update README

* update package.json metadata

authored by

bnewbold and committed by
GitHub
fecf4e41 2baba9b5

+87 -4
+50 -1
packages/lib/README.md
··· 1 - # DID PLC Library 1 + 2 + @did-plc/lib - DID PLC Typescript Client Library 3 + ================================================ 4 + 5 + [![NPM](https://img.shields.io/npm/v/@did-plc/lib)](https://www.npmjs.com/package/@did-plc/lib) 6 + [![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) 7 + 8 + 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). 9 + 10 + ## Client Usage 11 + 12 + Fetching account data from directory: 13 + 14 + ```typescript 15 + import * as plc from '@did-plc/lib' 16 + 17 + client = new plc.Client('https://plc.directory') 18 + 19 + let exampleDid = 'did:plc:yk4dd2qkboz2yv6tpubpc6co' 20 + 21 + // current account data, in terse object format 22 + const data = await client.getDocumentData(exampleDid) 23 + 24 + // or, the full DID Document 25 + const didDoc = await client.getDocument(exampleDid) 26 + ``` 27 + 28 + Registering a new DID PLC: 29 + 30 + ```typescript 31 + import { Secp256k1Keypair } from '@atproto/crypto' 32 + import * as plc from '@did-plc/lib' 33 + 34 + // please test against a sandbox or local development server 35 + client = new plc.Client('http://localhost:2582') 36 + 37 + let signingKey = await Secp256k1Keypair.create() 38 + let rotationKey = await Secp256k1Keypair.create() 39 + 40 + did = await client.createDid({ 41 + signingKey: signingKey.did(), 42 + handle: 'handle.example.com', 43 + pds: 'https://pds.example.com', 44 + rotationKeys: [rotationKey.did()], 45 + signer: rotationKey, 46 + }) 47 + ``` 2 48 49 + ## License 50 + 51 + MIT / Apache 2.0 dual-licensed.
+13 -1
packages/lib/package.json
··· 1 1 { 2 2 "name": "@did-plc/lib", 3 3 "version": "0.0.4", 4 - "main": "dist/index.js", 5 4 "license": "MIT", 5 + "description": "DID PLC Typescript Client Library", 6 + "keywords": [ 7 + "did-plc", 8 + "did", 9 + "atproto" 10 + ], 11 + "homepage": "https://web.plc.directory", 12 + "repository": { 13 + "type": "git", 14 + "url": "https://github.com/bluesky-social/did-method-plc", 15 + "directory": "packages/lib" 16 + }, 17 + "main": "dist/index.js", 6 18 "scripts": { 7 19 "test": "jest", 8 20 "prettier": "prettier --check src/",
+11 -1
packages/server/README.md
··· 1 - # DID PLC Server 1 + 2 + @did-plc/server - DID PLC Directory Service 3 + =========================================== 4 + 5 + Reference implementation of the PLC DID method, in Typescript. 6 + 7 + This is the software that runs the <https://plc.directory> service. 8 + 9 + ## License 10 + 11 + MIT / Apache 2.0 dual-licensed.
+13 -1
packages/server/package.json
··· 1 1 { 2 2 "name": "@did-plc/server", 3 3 "version": "0.0.1", 4 - "main": "dist/index.js", 5 4 "license": "MIT", 5 + "description": "DID PLC Directory Service", 6 + "keywords": [ 7 + "did-plc", 8 + "did", 9 + "atproto" 10 + ], 11 + "homepage": "https://web.plc.directory", 12 + "repository": { 13 + "type": "git", 14 + "url": "https://github.com/bluesky-social/did-method-plc", 15 + "directory": "packages/server" 16 + }, 17 + "main": "dist/index.js", 6 18 "scripts": { 7 19 "start": "node dist/bin.js", 8 20 "test": "./pg/with-test-db.sh jest",