mirror of https://codeberg.org/pzp/pzp-sdk.git
|
||
---|---|---|
declarations | ||
lib | ||
test | ||
.gitignore | ||
.woodpecker.yaml | ||
README.md | ||
package.json | ||
tsconfig.json |
README.md
pzp-sdk
JS module for helping you get started with PZP development
Installation
npm install pzp-sdk
This module has a lot of peer dependencies so make sure that those get installed properly as well.
Usage
const { promisify: p } = require('node:util')
const { createPeer } = require('pzp-sdk')
const { peer, account } = await createPeer()
await p(peer.db.feed.publish)({
account,
domain: "post",
data: {
text: 'woohoo a post'
}
})
await p(peer.close)()
For a bigger example of a PZP app built using the pzp-sdk you can take a look at Zooboard
API
This module has full JSDoc/TS types so typechecking and IDE autocomplete should be available (there are some problems with promisify handling types though).The various plugins available under peer.*
can be found more or less documented under the pzp codeberg. There is also some protocol documentation on the PZP website.