@octokit/plugin-enterprise-server
TypeScript icon, indicating that this package has built-in type declarations

17.2.0 • Public • Published

plugin-enterprise-server.js

Octokit plugin for GitHub Enterprise Server REST APIs

@latest Build Status

@octokit/rest and the @octokit/plugin-rest-endpoint-methods plugin it's using internally do not include methods for Enterprise Administration as they do not exist on https://api.github.com. This plugin adds endpoint methods for every GitHub Enterprise Server version that is currently supported.

Besides the admin-specific endpoints, there are differences between api.github.com and each GitHub Enterprise Server version. Instead of loading @octokit/plugin-rest-endpoint-methods you can optionally add all endpoint methods for each GitHub Enterprise Server version, including the admin endpoints.

Usage

Browsers

Load @octokit/plugin-enterprise-server and @octokit/core (or core-compatible module) directly from esm.sh

<script type="module">
  import { Octokit } from "https://esm.sh/@octokit/core";
  import { enterpriseServer220Admin } from "https://esm.sh/@octokit/plugin-enterprise-server";
</script>
Node

Install with npm install @octokit/core @octokit/plugin-enterprise-server. Optionally replace @octokit/core with a core-compatible module

const { Octokit } = require("@octokit/core");
const {
  enterpriseServer36Admin,
} = require("@octokit/plugin-enterprise-server");
const OctokitEnterprise36 = Octokit.plugin(enterpriseServer36Admin);
const octokit = new OctokitEnterprise36({
  auth: "secret123",
  baseUrl: "https://github.acme-inc.com/api/v3",
});

octokit.enterpriseAdmin.createUser({
  username: "octocat",
  email: "octocat@acme-inc.com",
});

The list of currently exported plugins are

How it works

The route definitions for the currently supported GitHub Enterprise versions are built automatically from @octokit/openapi. Each time there is a new @octokit/openapi release, the .github/workflows/update.yml workflow is triggered. If an update is found, a pull request is created.

LICENSE

MIT

Package Sidebar

Install

npm i @octokit/plugin-enterprise-server

Weekly Downloads

4,914

Version

17.2.0

License

MIT

Unpacked Size

2.1 MB

Total Files

30

Last publish

Collaborators

  • kfcampbell
  • nickfloyd
  • gr2m
  • octokitbot