Helper methods secure publish and subscribe to a topic
npm install @toruslabs/secure-pub-sub

This repo allow you to publish and subscribe to a single message in a topic
- Typescript compatible. Includes Type definitions
- All API's return Promises
This module is distributed in 3 formats
- lib.esm build dist/lib.esm/index.js in es6 format
- lib.cjs build dist/lib.cjs/index.js in es5 format
By default, the appropriate format is used for your specified usecase
You can use a different format (if you know what you're doing) by referencing the correct file
The cjs build is not polyfilled with core-js.
It is upto the user to polyfill based on the browserlist they target
CDN's serve the non-core-js polyfilled version by default. You can use a different
jsdeliver
``js`
unpkg
`js`
This is a plugin that works only on the client side. So please register it as a ssr-free plugin.
Add @toruslabs/secure-pub-sub to your project:
To allow your web app to retrieve keys:
Install the package
npm i @toruslabs/secure-pub-subyarn add @toruslabs/secure-pub-sub
or
- This package requires a peer dependency of @babel/runtime`
- Node 22+