@karmared/api
v0.0.2
Published
## Install
Downloads
1
Keywords
Readme
Karma API
Install
# npm install @karmared/api
or
# yarn add @karmared/api
Use
If you know email and password:
import Karma from "@karmared/api"
const EMAIL = "[email protected]", PASSWORD = "...";
const karma = await Karma.login(EMAIL, PASSWORD)
or if you know bearer token:
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.
const query = `
{
viewer {
id
}
}`
const response = await karma.request(query)
console.log(response) // {data: {viewer: {id: "..."}}}