Skip to content

Reduct Storage Client SDK for JavaScript

GitHub release (latest SemVer) npm GitHub Workflow Status

Asynchronous HTTP client for Reduct Storage written in TypeScript.

Features

  • Promise based
  • Support Reduct Storage API v0.8
  • Token authentication

Getting Started

Read here, how to run Reduct Storage. Then install the package:

npm i reduct-js

And run this example:

const {Client} = require("reduct-js")

const main = async () => {
  const client = new Client("https://play.reduct-storage.dev", {apiToken: "reduct"});

  const bucket = await client.getOrCreateBucket("bucket");

  const timestamp = Date.now() * 1000;
  await bucket.write("entry-1", "Hello, World!", timestamp);
  console.log(await bucket.read("entry-1", timestamp));
};

main()
  .then(() => console.log("done"))
  .catch((err) => console.error("oops: ", err));