▢️Getting Started

VSS API Client

The VSS API Client is a Node.js utility designed to interact with a Versioned Storage Service (VSS). It provides functionality to securely store, retrieve, and manage encrypted data using a cloud-hosted VSS server. Client code


Features

  • File Storage: Encrypt and upload files to the VSS server.

  • File Retrieval: Decrypt and fetch files from the server.

  • Key Version Management: List versions of stored keys for audit and recovery purposes.

  • Client-Side Encryption: Ensures data is encrypted locally using AES-256-GCM before being transmitted.

  • Protobuf Serialization: Leverages Protobuf for efficient data communication.


Prerequisites

  1. VSS Server: Access to a running VSS server instance. https://safe.thunderstack.org/vss

  2. Protobuf Schema: Obtain the vss.proto file from the VSS service provider.


Installation

  1. Clone the repository:

    git clone https://github.com/RGB-OS/vss-server
    cd https://github.com/RGB-OS/vss-server/nodejs-api-client
  2. Install dependencies:

    npm install
  3. Configure the client:

    • Update config.js with:

      • token: JWT token for authentication.

      • vssServerBaseUrl: Base URL for the VSS server.

      • ENCRYPTION_KEY: 32-byte AES encryption key in Base64 format.


Usage

1. Save a File

Upload a file to the VSS server:


2. Retrieve a File

Fetch and decrypt a file from the VSS server:


3. List Key Versions

Retrieve a list of versions for a specific key:


Configuration

config.js Example

Generate an AES-256 Encryption Key

Run the following command to generate a 32-byte key:


Directory Structure


Security

  • Client-Side Encryption: Data is encrypted locally using AES-256-GCM before being sent to the server.


Troubleshooting

Common Issues

  1. Invalid Token:

    • Ensure the token in config.js is valid and not expired.

  2. Connection Errors:

    • Verify the vssServerBaseUrl is correct and the server is running.

  3. Encryption Errors:

    • Ensure the ENCRYPTION_KEY meets format and length requirements.


Contact

For questions or support, reach out to [email protected].

Last updated