1.0.8 • Published 1 year ago

@ed.sahakian/theone v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

The One - SDK

NPM version License

A simple JavaScript API wrapper for accesing the The One API https://the-one-api.dev/

Install with npm or Yarn:

# via npm
npm install @ed.sahakian/theone

# or Yarn
yarn add @ed.sahakian/theone

Usage

// Import the package
import TheOne from '@ed.sahakian/theone'

// Initialize the SDK
const client = new TheOne({
	apiKey: 'XXX-API-KEY-XXX',
})

// Example of fetching all the books
client.books.getAll().then((res) => {
	console.log(res)
})

// Get one book by ID
client.books.getOne('XXX-ID-XXX').then((res) => {
	console.log(res)
})

Advanced usage of API using (pagination and sorting) based on The One SDK documentation https://the-one-api.dev/documentation

// Limit the result to first 100 character quotes only
client.quotes.getAll({ limit: '100' }).then((res) => {
	console.log(res)
})

// Limit the result to first 100 characters and sort on "name" column by asceding order
client.characters.getAll({ sort: 'name:asc', limit: '100' }).then((res) => {
	console.log(res)
})
1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago