Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@owlnext/heimdall-js

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@owlnext/heimdall-js

Heimdall API client & utils for javascript technologies

  • 1.0.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
41
decreased by-6.82%
Maintainers
1
Weekly downloads
 
Created
Source

heimdallJS

Heimdall API client & utils for javascript technologies.

Prerequisites

To use this client, you must first have an admin user on the Heimdall API.

Installation

npm -i --save @owlnext/heimdall-js

Usage

import Heimdall from '@owlnext/heimdall-js'

// first, authenticate your Heimdall client
const heimdall: Heimdall = new Heimdall();
heimdall.authenticate({
    login: '<your login>',
    password: '<your password>',
    application_uuid: '<your application UUID>'
});

// check if the client is authenticated
if(true === heimdall.isAuthenticated()) {
    // ...
}

// check the user connected
if('my_user_login' === heimdall.api.getCurrentLoggedIn()) {
    // ...
}

// encrypt a file with a new key
let encrypted: string;

heimdall.createKey(['<a group iri>']).then(key => {
    heimdall.getCipherKey(key.id).then(cipher => {
        encrypted = heimdall.encrypt('<your message>', cipher.cipherKey);
    });
});

// decrypt a file
let decrypted: string;

heimdall.getCipherKey('<key id>').then(cipher => {
    decrypted = heimdall.decrypt('<your encrypted message>', cipher.cipherKey);
});

Note: You also have access to the full API implementation with the api getter from the Heimdall object.

Keywords

FAQs

Package last updated on 08 Feb 2022

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