@uqbar/client-encryptor-api
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

client-encryptor-api

A library for handling encryption and decryption of WebSocket data (and later HTTP) from an Uqbar node.

Installation

npm install @uqbar/client-encryptor-api or yarn add @uqbar/client-encryptor-api

How to use

Import and instantiate the UqbarEncryptorApi:

import UqbarEncryptorApi from '@uqbar/client-encryptor'
const api = new UqbarEncryptorApi({
  nodeId, // You should set this on the window and then pass in. See the apps_home html for an example.
  channelId, // The channel that WS messages will come over, usually the process name or ID.
  uri = 'ws://' + window.location.host,
  onMessage = () => null, // Handle WS message
  onEncryptionReady = () => null, // Called when end-to-end encryption with the Uqbar node is ready. Recommended to use this instead of onOpen
  onOpen = () => null, // Handle WS open
  onClose = () => null, // Handle WS close
  onError = () => null, // Handle WS error
})

Readme

Keywords

none

Package Sidebar

Install

npm i @uqbar/client-encryptor-api

Weekly Downloads

1

Version

0.2.4

License

ISC

Unpacked Size

12.2 kB

Total Files

4

Last publish

Collaborators

  • 0x70b1a5
  • fabnev.hinmur