https://github.com/octokit/plugin-enterprise-server.js
Octokit plugin for GitHub Enterprise REST APIs
https://github.com/octokit/plugin-enterprise-server.js
hacktoberfest octokit-js plugin
Last synced: 7 months ago
JSON representation
Octokit plugin for GitHub Enterprise REST APIs
- Host: GitHub
- URL: https://github.com/octokit/plugin-enterprise-server.js
- Owner: octokit
- License: mit
- Created: 2018-12-13T07:11:50.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2025-05-20T06:25:01.000Z (8 months ago)
- Last Synced: 2025-05-20T06:31:26.081Z (8 months ago)
- Topics: hacktoberfest, octokit-js, plugin
- Language: TypeScript
- Homepage:
- Size: 9.36 MB
- Stars: 20
- Watchers: 6
- Forks: 14
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# plugin-enterprise-server.js
> Octokit plugin for GitHub Enterprise Server REST APIs
[](https://www.npmjs.com/package/@octokit/plugin-enterprise-server)
[](https://github.com/octokit/plugin-enterprise-server.js/actions?workflow=Test)
[`@octokit/rest`](https://github.com/octokit/rest.js/) and the [`@octokit/plugin-rest-endpoint-methods`](https://github.com/octokit/plugin-rest-endpoint-methods.js/) 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`](https://github.com/octokit/plugin-rest-endpoint-methods.js/) 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`](https://github.com/octokit/core.js) (or core-compatible module) directly from [esm.sh](https://esm.sh)
```html
import { Octokit } from "https://esm.sh/@octokit/core";
import { enterpriseServer220Admin } from "https://esm.sh/@octokit/plugin-enterprise-server";
```
Node
Install with `npm install @octokit/core @octokit/plugin-enterprise-server`. Optionally replace `@octokit/core` with a core-compatible module
```js
import { Octokit } from "@octokit/core";
import { enterpriseServer316Admin } from "@octokit/plugin-enterprise-server";
```
```js
const OctokitEnterprise12 = Octokit.plugin(enterpriseServer316Admin);
const octokit = new OctokitEnterprise316({
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
- [`enterpriseServer313Admin`](docs/ghe-313.md#admin)
- [`enterpriseServer313`](docs/ghe-313.md#others)
- [`enterpriseServer314Admin`](docs/ghe-314.md#admin)
- [`enterpriseServer314`](docs/ghe-314.md#others)
- [`enterpriseServer315Admin`](docs/ghe-315.md#admin)
- [`enterpriseServer315`](docs/ghe-315.md#others)
- [`enterpriseServer316Admin`](docs/ghe-315.md#admin)
- [`enterpriseServer316`](docs/ghe-315.md#others)
## How it works
The route definitions for the currently supported GitHub Enterprise versions are built automatically from [`@octokit/openapi`](https://github.com/octokit/openapi). Each time there is a new `@octokit/openapi` release, the [`.github/workflows/update.yml`](.github/workflows/update.yml) workflow is triggered. If an update is found, a pull request is created.
## LICENSE
[MIT](LICENSE)