Skip to content

An Octokit constructor with OAuth authentication for Script Kit

License

Notifications You must be signed in to change notification settings

gr2m/scriptkit-octokit

Repository files navigation

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

About

An Octokit constructor with OAuth authentication for Script Kit

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published