# @karmared/api

> ## Install

Latest version **0.0.2** (published 2021-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @karmared/api
pnpm add @karmared/api
yarn add @karmared/api
bun add @karmared/api
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2021-01-15 |
| First published | 2020-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | seanchas, sir_rois, scientistnik |

## Links

- npm: https://www.npmjs.com/package/@karmared/api
- npm.io page: https://npm.io/package/@karmared/api

## Dependencies (1)

- [cross-fetch](https://npm.io/package/cross-fetch.md) ^3.0.6

## Recent versions

- 0.0.2 (latest) — 2021-01-15
- 0.0.1 — 2020-12-18

## README

# Karma API

## Install

```js
# npm install @karmared/api
```
or
```js
# yarn add @karmared/api
```

## Use

If you know email and password:
```js
import Karma from "@karmared/api"

const EMAIL = "example@mail.com", PASSWORD = "...";

const karma = await Karma.login(EMAIL, PASSWORD)
```

or if you know bearer token:
```js
import Karma from "@karmared/api"

const BEARER_TOKEN = "..."

const karma = new Karma({token: BEARER_TOKEN})
```

### Requests

You can see all requests on site [https://my.karma.red/graphql](https://my.karma.red/graphql).

```js
const query = `
{
  viewer {
    id
  }
}`

const response = await karma.request(query)
console.log(response) // {data: {viewer: {id: "..."}}}
```

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