@evervault/sdk
Advanced tools
Comparing version 0.6.0 to 1.0.0
{ | ||
"name": "@evervault/sdk", | ||
"version": "0.6.0", | ||
"description": "evervault Browser SDK", | ||
"version": "1.0.0", | ||
"description": "Node.js SDK for working with evervault cages", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "mocha 'tests/**/*.test.js'", | ||
"test:coverage": "nyc --reporter=text npm run test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/evervault/evervault-sdk.git" | ||
"url": "git+https://github.com/evervault/evervault-node-sdk.git" | ||
}, | ||
"main": "index.js", | ||
"keywords": [ | ||
"node", | ||
"evervault", | ||
"cages" | ||
], | ||
"author": "evervault (https://evervault.com)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/evervault/evervault-sdk/issues" | ||
"url": "https://github.com/evervault/evervault-node-sdk/issues" | ||
}, | ||
"scripts": { | ||
"build": "npx webpack --mode=production", | ||
"test": "node test/index.js" | ||
"homepage": "https://github.com/evervault/evervault-node-sdk#readme", | ||
"dependencies": { | ||
"phin": "^3.5.0", | ||
"uuid": "^8.1.0" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://evervault.com/", | ||
"devDependencies": { | ||
"@babel/core": "^7.6.2", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babelify": "^10.0.0", | ||
"chai": "^4.2.0", | ||
"mocha": "^7.0.1", | ||
"puppeteer": "^2.1.1", | ||
"sinon": "^9.0.1", | ||
"webpack": "^4.41.2", | ||
"webpack-cli": "^3.3.11" | ||
}, | ||
"dependencies": {} | ||
"mocha": "^8.0.1", | ||
"nock": "^12.0.3", | ||
"nyc": "^15.1.0", | ||
"rewire": "^5.0.0", | ||
"sinon": "^9.0.2", | ||
"sinon-chai": "^3.5.0" | ||
} | ||
} |
@@ -1,92 +0,1 @@ | ||
<img src="https://raw.githubusercontent.com/evervault/evervault-sdk/master/logo.png" height="35" /> | ||
## About | ||
The evervault SDK allows developers to integrate with [evervault auth](https://evervault.com/auth) and encrypt/decrypt data within their web app. Built on the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API). | ||
## API Reference | ||
### checkAuth | ||
```javascript | ||
evervault.checkAuth(appId): void | ||
``` | ||
Check a user's auth status in the system, and redirect them if they are unauthenticated. | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| appId | `String` | The unique identifier for your app in the evervault system | | ||
### encrypt | ||
```javascript | ||
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`. | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| data | `any` | the data to be encrypted | | ||
| [encryptOptions](#encryptoptions) | `object` | control how your data is encrypted | | ||
### encryptOptions | ||
| Key | Value | Description | | ||
| --- | --- | --- | | ||
| preserveObjectShape | `boolean` | if true, javascript objects will only have their values encrypted, if false objects will be stringified | | ||
| fieldsToEncrypt | `Array<String>` | a list of fields in an object to encrypt | | ||
| privateKey | `String` | a base64 representation of a user's evervault secret key | | ||
### decrypt | ||
```javascript | ||
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. | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| data | `any` | the data to be decrypted, be it an object, array or a string | | ||
| privateKey | `String` | a base64 representation of a user's evervault secret key | | ||
### set | ||
```javascript | ||
evervault.set(toSet): Promise<Object> | ||
``` | ||
Save data on behalf of the user in evervault storage. | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| toSave | `Object` | the data to be saved. Must be an object in `{ "key": "value" }` form | | ||
### get | ||
```javascript | ||
evervault.get([toGet]): Promise<Object> | ||
``` | ||
Retrieve data on behalf of the user in evervault storage. | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| toGet | `String` | Optional. the data to be retrieved. Must resolve to a previously stored piece of data | | ||
### logout | ||
```javascript | ||
logout(): void | ||
``` | ||
Remove a user's credentials and redirect them to evervault auth. | ||
### refreshAccessToken | ||
```javascript | ||
refreshAccessToken([accessToken, refreshToken]): Promise<Object> | ||
``` | ||
Refresh a user's access token in the evervault system. | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| accessToken | `String` | a user's evervault access token to authenticate them in your system | | ||
| refreshToken | `String` | a user's evervault refresh token to keep them authenticated | | ||
# evervault node sdk |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7
22
0
0
37951
2
1059
1
1
+ Addedphin@^3.5.0
+ Addeduuid@^8.1.0
+ Addedcentra@2.7.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedphin@3.7.1(transitive)
+ Addeduuid@8.3.2(transitive)