# artur-moczulski-sdk

> SDK for The One API for the LibLab coding assessment.

Latest version **1.5.6** (published 2022-12-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install artur-moczulski-sdk
pnpm add artur-moczulski-sdk
yarn add artur-moczulski-sdk
bun add artur-moczulski-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.6 |
| Published | 2022-12-27 |
| First published | 2022-12-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 26.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Artur Moczulski |
| Maintainers | arturmoczulski |

## Links

- npm: https://www.npmjs.com/package/artur-moczulski-sdk
- Repository: https://github.com/ArturMoczulski/artur-moczulski-SDK
- Homepage: https://github.com/ArturMoczulski/artur-moczulski-SDK#readme
- Issues: https://github.com/ArturMoczulski/artur-moczulski-SDK/issues
- npm.io page: https://npm.io/package/artur-moczulski-sdk

## Dependencies (2)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.7
- [ansi-colors](https://npm.io/package/ansi-colors.md) ^4.1.3

## Recent versions

- 1.5.6 (latest) — 2022-12-27
- 1.5.5 — 2022-12-27
- 1.5.4 — 2022-12-27
- 1.5.3 — 2022-12-27
- 1.5.2 — 2022-12-27
- 1.5.1 — 2022-12-27
- 1.5.0 — 2022-12-27
- 1.4.0 — 2022-12-27
- 1.3.0 — 2022-12-27
- 1.2.0 — 2022-12-27
- 1.1.1 — 2022-12-27
- 1.1.0 — 2022-12-27
- 1.0.0 — 2022-12-26

## README

# artur-moczulski-SDK

This SDK provides an easy programmatic layer over [The One API](https://the-one-api.dev/). To use it
you will need to obtain an [access key for The One API](https://the-one-api.dev/sign-up).

## The easiest way to see the SDK in action

```
git clone git@github.com:ArturMoczulski/artur-moczulski-SDK.git
cd artur-moczulski-SDK/docs/example-project
npm install
cp .env.example .env
```

Change the access key in .env to your The One API access key in the example project.

`node index.js`

## Install

`cd` into your project and type:

`npm install artur-moczulski-SDK`

## Basic Usage

### Importing the library in your code

```
const theOneSDK = require('artur-moczulski-SDK')()
```

### Authentication

```
const theOneSDK = require('artur-moczulski-SDK')({
  accessKey: "yourAccessKey"
})
```

### Working with the Books methods 

*Note:* The *book/* endpoint is the only endpoint which will not require a prior authentication.

#### Obtain the list of all books

```
let books = await theOneSDK.books()

console.log(books)
```

#### Fetch a specific book

```
let book = await theOneSDK.book(id)

console.log(book)
```

#### Fetch chapters of a book

```
let book = await theOneSDK.book(id)
await book.fetchChapters()

console.log(book.chapters)
```

### Working with the Quotes methods 

#### Obtain the list of all books

*Note:* The *quote/* endpoint will require an access key to be configured

```
let quotes = await theOneSDK.quotes()

console.log(quotes)
```

## Testing

To run all the tests:

`npm test`

## Documention

### Example project

This repo contains an example project in *./docs/example-project* which utilizes
the SDK through the npm registry. Some exapmles of real world library usage
can be found there. The purpose of the example project is to be a simple
The One API browser.

---
_Source: https://npm.io/package/artur-moczulski-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
