Setup for Koa

Add Supergood as a dependency

npm install supergood@latest

Initialize Supergood as early in your app as possible

import Koa from "koa";
import Supergood from "supergood"

// or using CommonJS
// const Koa = require('koa');
// const Supergood = require('supergood);

const app = new Koa();

Supergood.init();

app.listen(3000);

Environment variables

Set the environment variables SUPERGOOD_CLIENT_ID and SUPERGOOD_CLIENT_SECRET using the API keys generated in the getting started instructions.

Passing keys

You can also pass the API keys in manually without setting environment variables.

Replace <CLIENT_ID> and <CLIENT_SECRET> with the API keys you generated in the getting started instructions.

const Supergood = require('supergood')

Supergood.init({ clientId: <CLIENT_ID>, clientSecret: <CLIENT_SECRET> })

Last updated