lucid-ts-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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

Package Sidebar

Install

npm i lucid-ts-sdk

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

18.6 kB

Total Files

7

Last publish

Collaborators

  • rigwild