How to use the @octokit/core.Octokit.plugin function in @octokit/core

To help you get started, we’ve selected a few @octokit/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github octokit / routes / bin / notify-users.js View on Github external
const APP_ID = 37848;
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const EVENT_TYPE = process.env.INPUT_EVENT_TYPE;
const VERSION = process.env.INPUT_VERSION;

const { createAppAuth } = require("@octokit/auth-app");
const { Octokit } = require("@octokit/core");
const { paginateRest } = require("@octokit/plugin-paginate-rest");

const OctokitWithPagination = Octokit.plugin(paginateRest);

main();

async function main() {
  try {
    const octokit = new OctokitWithPagination({
      auth: {
        id: APP_ID,
        privateKey: PRIVATE_KEY
      },
      authStrategy: createAppAuth
    });

    const installations = await octokit.paginate("GET /app/installations", {
      mediaType: { previews: ["machine-man"] },
      per_page: 100

@octokit/core

Extendable client for GitHub's REST & GraphQL APIs

MIT
Latest version published 7 months ago

Package Health Score

93 / 100
Full package analysis