index-sdk
v0.3.1
Published
index-sdk is designed to simplify the development process and enable developers to interact with RSS3 API efficiently
Downloads
11
Readme
index-sdk
index-sdk is designed to simplify the development process and enable developers to interact with RSS3 API efficiently
Usage
# npm
npm i index-sdk
# yarn
yarn add index-sdk
# pnpm
pnpm add index-sdk
If you want to customize the endpoint, you can:
import { IndexClient } from 'index-sdk'
const index = new IndexClient({ endpoint: { data: 'https://test-pregod.rss3.dev/v1' } })
And of course you can also use all of fetch options (RequestInit
).
Examples
Get all of Vitalik's profiles on Web3
import { IndexClient } from 'index-sdk'
const index = new IndexClient()
const { result: profiles } = await index.profiles.get('vitalik.eth')
Now you know where to find Vitalik!
Get all notes posted by DIYgod on xLog
import { IndexClient } from 'index-sdk'
const index = new IndexClient()
const { result: notes } = await index.notes.get('diygod.eth', {
platform: ['xLog']
})
Now you can even use xLog as a headless CMS