# vault_http_api

> The_VGS_Vault_HTTP_API_is_used_for_storing_retrieving_and_managing_sensitive_data__aka_Tokenization_within_a_VGS_Vault_The_VGS_API_is_organized_around_REST__Our_API_is_built_with_a_predictable_resource_oriented_structure_uses_JSON_encoded_requests_and_res

Latest version **1.0.0** (published 2022-08-10) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install vault_http_api
pnpm add vault_http_api
yarn add vault_http_api
bun add vault_http_api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-08-10 |
| First published | 2022-08-10 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 101.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | antjazl |

## Links

- npm: https://www.npmjs.com/package/vault_http_api
- npm.io page: https://npm.io/package/vault_http_api

## Dependencies (2)

- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.0.0
- [superagent](https://npm.io/package/superagent.md) ^5.3.0

## Recent versions

- 1.0.0 (latest) — 2022-08-10

## README

# vault_http_api

VaultHttpApi - JavaScript client for vault_http_api
The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault.

The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication.

## What is VGS

Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store.

VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case.

**Tokenization** is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. [Get started with Tokenization](https://www.verygoodsecurity.com/docs/tokenization/getting-started).

**Zero Data** is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. [Get started with Zero Data](https://www.verygoodsecurity.com/docs/getting-started/before-you-start).

Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. [Get started with Control](https://www.verygoodsecurity.com/docs/control).

## Learn about Tokenization

- [Create an Account for Free Tokenization](https://dashboard.verygoodsecurity.com/tokenization)
- [Try a Tokenization Demo](https://www.verygoodsecurity.com/docs/tokenization/getting-started)
- [Install a Tokenization SDK](https://www.verygoodsecurity.com/docs/tokenization/client-libraries)

### Authentication

This API uses `Basic` authentication and is implemented using industry best practices to ensure the security of the connection. Read more about [Identity and Access Management at VGS](https://www.verygoodsecurity.com/docs/vault/the-platform/iam)

Credentials to access the API can be generated on the
[dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings
section of the vault of your choosing.

[Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials)

## Resource Limits

### Data Limits

This API allows storing data up to 32MB in size.

### Rate Limiting

The API allows up to 3,000 requests per minute. Requests are associated with
the vault, regardless of the access credentials used to authenticate the
request.

Your current rate limit is included as HTTP headers in every API response:

| Header Name             | Description                                              |
|-------------------------|----------------------------------------------------------|
| `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. |

If you exceed the rate limit, the API will reject the request with HTTP
[429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429).

### Errors

The API uses standard HTTP status codes to indicate whether the request
succeeded or not.

In case of failure, the response body will be JSON in a predefined format.
For example, trying to create too many aliases at once results in the
following response:

```json
{
    \"errors\": [
        {
            \"status\": 400,
            \"title\": \"Bad request\",
            \"detail\": \"Too many values (limit: 20)\",
            \"href\": \"https://api.sandbox.verygoodvault.com/aliases\"
        }
    ]
}
```

This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install vault_http_api --save
```

Finally, you need to build the module:

```shell
npm run build
```

##### Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:

```shell
npm install
```

Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:

```shell
npm link
```

To use the link you just defined in your project, switch to the directory you want to use your vault_http_api from, and run:

```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

Finally, you need to build the module:

```shell
npm run build
```

#### git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var VaultHttpApi = require('vault_http_api');

var defaultClient = VaultHttpApi.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

var api = new VaultHttpApi.AliasesApi()
var opts = {
  'createAliasesRequest': {"data":[{"value":122105155,"classifiers":["bank-account"],"format":"UUID","storage":"PERSISTENT"}]} // {CreateAliasesRequest} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createAliases(opts, callback);

```

## Documentation for API Endpoints

All URIs are relative to *https://api.sandbox.verygoodvault.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*VaultHttpApi.AliasesApi* | [**createAliases**](docs/AliasesApi.md#createAliases) | **POST** /aliases | Create aliases
*VaultHttpApi.AliasesApi* | [**deleteAlias**](docs/AliasesApi.md#deleteAlias) | **DELETE** /aliases/{alias} | Delete alias
*VaultHttpApi.AliasesApi* | [**revealAlias**](docs/AliasesApi.md#revealAlias) | **GET** /aliases/{alias} | Reveal single alias
*VaultHttpApi.AliasesApi* | [**revealMultipleAliases**](docs/AliasesApi.md#revealMultipleAliases) | **GET** /aliases | Reveal multiple aliases
*VaultHttpApi.AliasesApi* | [**updateAlias**](docs/AliasesApi.md#updateAlias) | **PUT** /aliases/{alias} | Update data classifiers


## Documentation for Models

 - [VaultHttpApi.Alias](docs/Alias.md)
 - [VaultHttpApi.AliasFormat](docs/AliasFormat.md)
 - [VaultHttpApi.ApiError](docs/ApiError.md)
 - [VaultHttpApi.CreateAliases201Response](docs/CreateAliases201Response.md)
 - [VaultHttpApi.CreateAliasesRequest](docs/CreateAliasesRequest.md)
 - [VaultHttpApi.CreateAliasesRequestDataInner](docs/CreateAliasesRequestDataInner.md)
 - [VaultHttpApi.CreateAliasesRequestNew](docs/CreateAliasesRequestNew.md)
 - [VaultHttpApi.CreateAliasesRequestReference](docs/CreateAliasesRequestReference.md)
 - [VaultHttpApi.RevealAlias200Response](docs/RevealAlias200Response.md)
 - [VaultHttpApi.RevealMultipleAliases200Response](docs/RevealMultipleAliases200Response.md)
 - [VaultHttpApi.RevealMultipleAliasesDefaultResponse](docs/RevealMultipleAliasesDefaultResponse.md)
 - [VaultHttpApi.RevealedData](docs/RevealedData.md)
 - [VaultHttpApi.UpdateAliasRequest](docs/UpdateAliasRequest.md)
 - [VaultHttpApi.UpdateAliasRequestData](docs/UpdateAliasRequestData.md)


## Documentation for Authorization



### basicAuth

- **Type**: HTTP basic authentication

---
_Source: https://npm.io/package/vault_http_api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
