Socket
Book a DemoInstallSign in
Socket

@basis-theory/basis-theory-js-encryption-node

Package Overview
Dependencies
Maintainers
10
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@basis-theory/basis-theory-js-encryption-node

Node (Crypto) Encryption Provider for the [Basis Theory](https://basistheory.com/) JS [Encryption SDK](https://github.com/Basis-Theory/basis-theory-js-encryption).

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
10
Created
Source

BasisTheory JS Node Encryption Provider

Node (Crypto) Encryption Provider for the Basis Theory JS Encryption SDK.

Installation

Using Node Package Manager

npm install --save @basis-theory/basis-theory-js-encryption-node

Using Yarn

yarn add @basis-theory/basis-theory-js-encryption-node

Documentation

For further documentation and examples, please refer to our Docs.

Usage

Initialization and Usage with BasisTheoryEncryption

import { BasisTheoryEncryption } from '@basis-theory/basis-theory-js-encryption';
import { BasisTheoryNodeEncryptionProvider } from '@basis-theory/basis-theory-js-encryption-node';

const nodeProvider = new BasisTheoryNodeEncryptionProvider();
const btEncryption = await new BasisTheoryEncryption().init([nodeProvider]);

Caching and Repositories

The default cache implementation uses node-cache, but users can implement their own from the interface. Local Key Repository and Provider Key Repository implementations are provider for testing. It's expected that the user provides their own repository implementations through the init call.

import { BasisTheoryEncryption } from '@basis-theory/basis-theory-js-encryption';
import { BasisTheoryNodeEncryptionProvider } from '@basis-theory/basis-theory-js-encryption-node';

const nodeProvider = new BasisTheoryNodeEncryptionProvider().init({
  cache: new MyCacheService(),
  keyRepository: new MyKeyRepository(),
  providerKeyRepository: new MyProviderKeyRepository(),
  rsaKeySize: 2048,
});


const btEncryption = await new BasisTheoryEncryption().init([nodeProvider]);

Development

The provided scripts with the SDK will check for all dependencies, build the solution, and run all tests.

Dependencies

  • NodeJS > 10.12.0
  • Yarn

Build the SDK and run Tests

Run the following command from the root of the project:

make verify

FAQs

Package last updated on 21 Sep 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.