New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@consento/api

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@consento/api

JavasScript API for building things with consento.

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30
increased by1400%
Maintainers
2
Weekly downloads
 
Created
Source

@consento/api

@consento/api is the main API for build consento systems.

Under heavy development.

Setup

The consento API has a few configuration points.

const { setup } = require('@consento/api')
const api = setup({
  core: require('@consento/crypto/core/sodium') // or '@consento/crypto/core/friends' depending on environment
  notificationTransport // Implementation of notification transport
})

Crypto

@consento/crypto is the foundation upon which Consento is built.

The API exposes the crypto primitives through api.crypto. e.g.:

const { Sender } = api.crypto

Notifications

The Consento API comes with an end-to-end encrypted notification system.

const { notifications } = api

Any ISender instance is able to submit notifications:

notifications.send(sender, 'Hello World')

For another device/instance to receive the notification, the device needs to first register the matching IReceiver

notifications.subscribe(sender.newReceiver())

All messages are received through a single handler:

notifications.on('message', (receiver: IReceiver, message) => {
  // Handle the message result.
})

Of course it is possible to unsubscribe from receiving messages:

notifications.unsubscribe(receiver)

License

MIT

FAQs

Package last updated on 04 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc