scriptkit-octokit
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i scriptkit-octokit

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

20.2 kB

Total Files

11

Last publish

Collaborators

  • gr2m