Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

victoria-sdk

1.0.6 • Public • Published

Victoria SDK

Victoria SDK provides an easy to access interface for frontend applications consuming data from the core API.

Installation

npm i victoria-sdk

or

yarn add victoria-sdk

Example usage:

 
import Victoria from 'victoria-sdk'
 
try {
  const key = 'my_victoria_api_key'
  // Only Specify the domain if you're developing localy
  const domain = 'http://127.0.0.1:3001'
 
  const victoria = new Victoria.VictoriaClient(key, domain)
 
  const client = await victoria.createClient()
 
  console.log(client) // blog data
} catch (err) {
  console.error(err)
}

Getting a post by ID

try {
  const posts = await client.getPostByID('some_random_post_id')
 
  console.log(posts) // Render posts
} catch (error) {
  console.error(err)
}

WIP...

Install

npm i victoria-sdk

DownloadsWeekly Downloads

34

Version

1.0.6

License

ISC

Unpacked Size

20.5 kB

Total Files

11

Last publish

Collaborators

  • avatar