Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/lucid-kv/ts-sdk
- Owner: lucid-kv
- License: mit
- Created: 2019-11-01T13:25:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-29T02:01:22.000Z (over 2 years ago)
- Last Synced: 2024-11-06T23:13:04.329Z (about 2 months ago)
- Topics: api-wrapper, http-client, key-value, kvstore, lucid, lucid-kv, typescript, wrapper
- Language: TypeScript
- Homepage: https://lucid-kv.github.io/ts-sdk/index.html
- Size: 144 KB
- Stars: 3
- Watchers: 7
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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.2const 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)