0.2.4 • Published 4 months ago

@uqbar/client-encryptor-api v0.2.4

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

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
})
0.2.3

4 months ago

0.2.2

4 months ago

0.2.4

4 months ago

0.2.1

5 months ago

0.2.0

5 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

7 months ago