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

@evervault/sdk

Package Overview
Dependencies
Maintainers
5
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evervault/sdk

evervault Browser SDK

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.9K
decreased by-10.88%
Maintainers
5
Weekly downloads
 
Created
Source

About

The evervault SDK allows developers to integrate with evervault auth and encrypt/decrypt data within their web app. Built on the Web Crypto API.

API Reference

checkAuth

evervault.checkAuth(appId): void

Check a user's auth status in the system, and redirect them if they are unauthenticated.

ParamTypeDescription
appIdStringThe unique identifier for your app in the evervault system

encrypt

evervault.encrypt(data[, encryptOptions]): Promise<String>

Encrypt data using a user's secret key. The encrypt function will handle any data excluding undefined and Symbol.

ParamTypeDescription
dataanythe data to be encrypted
encryptOptionsobjectcontrol how your data is encrypted

encryptOptions

KeyValueDescription
preserveObjectShapebooleanif true, javascript objects will only have their values encrypted, if false objects will be stringified
fieldsToEncryptArray<String>a list of fields in an object to encrypt
privateKeyStringa base64 representation of a user's evervault secret key

decrypt

evervault.decrypt(data[, privateKey]): Promise<String>

Decrypt evervault encrypted data. Decrypt will preserve the shape of any object it's given (e.g. Array or Object). Any stringified data that enters decrypt will be parsable when it has been decrypted.

ParamTypeDescription
dataanythe data to be decrypted, be it an object, array or a string
privateKeyStringa base64 representation of a user's evervault secret key

set

evervault.set(toSet): Promise<Object>

Save data on behalf of the user in evervault storage.

ParamTypeDescription
toSaveObjectthe data to be saved. Must be an object in { "key": "value" } form

get

evervault.get([toGet]): Promise<Object>

Retrieve data on behalf of the user in evervault storage.

ParamTypeDescription
toGetStringOptional. the data to be retrieved. Must resolve to a previously stored piece of data

logout

logout(): void

Remove a user's credentials and redirect them to evervault auth.

refreshAccessToken

refreshAccessToken([accessToken, refreshToken]): Promise<Object>

Refresh a user's access token in the evervault system.

ParamTypeDescription
accessTokenStringa user's evervault access token to authenticate them in your system
refreshTokenStringa user's evervault refresh token to keep them authenticated

FAQs

Package last updated on 08 Apr 2020

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