Go to file
Jacob Karlsson 6a8378bced 1.0.0 2024-05-20 17:41:53 +02:00
declarations Add createPeer 2024-05-17 17:43:16 +02:00
lib Create account when creating peer 2024-05-20 13:41:11 +02:00
test Create account when creating peer 2024-05-20 13:41:11 +02:00
.gitignore Add package.json 2024-05-16 15:47:14 +02:00
.woodpecker.yaml Add simple test 2024-05-17 18:41:17 +02:00
README.md Add simple readme 2024-05-20 17:38:49 +02:00
package.json 1.0.0 2024-05-20 17:41:53 +02:00
tsconfig.json Add simple test 2024-05-17 18:41:17 +02:00

README.md

pzp-sdk

JS module for helping you get started with PZP development

https://pzp.wiki/

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.