Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.02 KB

README-Template.md

File metadata and controls

42 lines (29 loc) · 1.02 KB

Kloak Bridge

The Kloak Bridge library.

Usage

Add an authorization token for reading packages in the GitHub package repository under the @conet-project organization to your ~/.npmrc.

Add the package repository to your project .yarnrc:

"@conet-project:registry" "https://npm.pkg.github.com/"

Add the dependency to your project:

yarn add @conet-project/kloak-bridge

Import StorageHelper from package and initialize new instance.

import { KloakBridge } from '@conet-project/kloak-bridge';
const kloakBridge = new KloakBridge();

Create a KeyContainer using StorageHelper and save into IndexedDB.

const keyChainContainer = await kloakBridge.createKeyContainer('mysupersecretpassword')

Check if a KeyContainer exists in IndexedDB.

const hasKeyContainer = await kloakBridge.checkKeyContainer();

Unlock a KeyContainer from IndexedDB. (Will perform a check before).

const unlocked = await kloakBridge.unlockContainer('mysupersecretpassword');