Options
All
  • Public
  • Public/Protected
  • All
Menu

lucid-ts-sdk

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

Generated using TypeDoc