1.0.4 • Published 3 years ago

scriptkit-octokit v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

scriptkit-octokit

An Octokit constructor with OAuth authentication for Script Kit

@latest Build Status

Usage

Minimal usage

const { Octokit } = await npm("scriptkit-octokit");

const octokit = new Octokit();

// calling octokit.auth({ type: "oauth" }) or sending any request will
// start the OAuth Device Flow to create a new token
octokit.auth({ type: "oauth" });

With options

const octokit = new Octokit({
  auth: {
    // The ClientID of your own OAuth App.
    // Default's to @gr2m's "Kit Auth" OAuth App
    clientId?: "34e4eac44e03b0daa82b",
    // Set required scopes
    scopes: ["repo", "user", "notifications"],
    // Set a custom environmen variable name,
    // defaults to "GITHUB_TOKEN_SCOPE1_SCOPE2_etc".
    // Set to false to not persist the token
    env: "GITHUB_TOKEN_MY_APP",
  },
});

Contributing

See CONTRIBUTING.md

License

MIT