Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lucid-kv/ts-sdk

Lucid KV TypeScript wrapper 🍬 High performance and distributed KV store accessible through an HTTP API
https://github.com/lucid-kv/ts-sdk

api-wrapper http-client key-value kvstore lucid lucid-kv typescript wrapper

Last synced: about 1 month ago
JSON representation

Lucid KV TypeScript wrapper 🍬 High performance and distributed KV store accessible through an HTTP API

Awesome Lists containing this project

README

        

# Lucid TypeScript SDK
[![npm](https://img.shields.io/npm/v/lucid-ts-sdk?label=npm)](https://www.npmjs.com/package/lucid-ts-sdk)
[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/lucid-kv/ts-sdk/blob/master/LICENSE)

Lucid KV TypeScript wrapper 🍬 High performance and distributed KV store accessible through an HTTP API.

This packages uses [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) to make sure it works on both the browser and Node.js.

## Install
```sh
yarn add lucid-ts-sdk
```

## Usage
```ts
import { LucidAPI } from 'lucid-ts-sdk'

const setup = async () => {
// Create a Lucid API wrapper instance
const Lucid = new LucidAPI('http://127.0.0.1:7020/api', 'your-Lucid-authentication-JSON-Web-Token')

// Initialize the wrapper instance (validate endpoint and JWT)
const version = await Lucid.init()
console.log(version) // 0.1.2

const content = await Lucid.getKey('check-token').then(res => res.json())
console.log(content) // { code: 0, message: 'Lucid Version 0.1.2', details: null }
}

setup()
```

## SDK API documentation
[Lucid TypeScript SDK documentation](https://lucid-kv.github.io/ts-sdk/classes/_index_.lucidapi.html)

## License
[The MIT License](./LICENSE)