Skip to content

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

License

Notifications You must be signed in to change notification settings

lucid-kv/ts-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lucid TypeScript SDK

npm License

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

This packages uses isomorphic-fetch to make sure it works on both the browser and Node.js.

Install

yarn add lucid-ts-sdk

Usage

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

License

The MIT License