# @octokit/plugin-enterprise-rest

> Octokit plugin for GitHub Enterprise REST APIs

Latest version **6.0.1** (published 2020-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @octokit/plugin-enterprise-rest
pnpm add @octokit/plugin-enterprise-rest
yarn add @octokit/plugin-enterprise-rest
bun add @octokit/plugin-enterprise-rest
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.0.1 |
| Published | 2020-01-14 |
| First published | 2018-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Gregor Martynus |
| Maintainers | bkeepers, gr2m, octokitbot |
| Keywords | octokit, github, api, rest, plugin, enterprise |

## Links

- npm: https://www.npmjs.com/package/@octokit/plugin-enterprise-rest
- Repository: https://github.com/octokit/plugin-enterprise-rest.js
- Homepage: https://github.com/octokit/plugin-enterprise-rest.js#readme
- Issues: https://github.com/octokit/plugin-enterprise-rest.js/issues
- npm.io page: https://npm.io/package/@octokit/plugin-enterprise-rest

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 6.0.1 (latest) — 2020-01-14
- 6.0.0 — 2019-11-13
- 5.0.0 — 2019-10-06
- 4.0.0 — 2019-10-06
- 3.6.2 — 2019-07-17
- 3.6.1 — 2019-06-10
- 3.6.0 — 2019-06-07
- 3.5.0 — 2019-06-07
- 3.4.2 — 2019-05-30
- 3.4.1 — 2019-05-29
- 3.4.0 — 2019-05-24
- 3.3.0 — 2019-05-23
- 3.2.0 — 2019-04-19
- 3.1.0 — 2019-04-16
- 3.0.0 — 2019-03-31
- … 11 more at https://npm.io/package/@octokit/plugin-enterprise-rest/versions

## README

# plugin-enterprise-rest.js

> Octokit plugin for GitHub Enterprise REST APIs

[![@latest](https://img.shields.io/npm/v/@octokit/plugin-enterprise-rest.svg)](https://www.npmjs.com/package/@octokit/plugin-enterprise-rest)
![Build Status](https://github.com/octokit/plugin-enterprise-rest.js/workflows/Test/badge.svg)
[![Greenkeeper badge](https://badges.greenkeeper.io/octokit/plugin-enterprise-rest.js.svg)](https://greenkeeper.io/)

`@octokit/rest` does not include methods for Enterprise Administration as they are not usable against https://api.github.com. This plugin adds these endpoints based on the GitHub Enterprise version you need.

## Usage

```js
const Octokit = require("@octokit/rest").plugin(
  require("@octokit/plugin-enterprise-rest/ghe-2.18")
);
const octokit = new Octokit({
  baseUrl: "https://github.acme-inc.com/api/v3"
});

octokit.enterpriseAdmin.promoteOrdinaryUserToSiteAdministrator({
  username: "octocat"
});
```

There can be differences in REST API between `api.github.com` and the different GitHub Enterprise versions. Some of the endpoint methods from `@octokit/rest` might not work. For these cases you can load the endpoint methods for all scopes for a certain GitHub Enterprise version, not only the `.enterprise` scope. This will override existing endpoint methods.

```js
const Octokit = require("@octokit/rest").plugin(
  require("@octokit/plugin-enterprise-rest/ghe-2.18/all")
);
const octokit = new Octokit({
  baseUrl: "https://github.acme-inc.com/api/v3"
});

octokit.issues.addLabels({
  owner,
  repo,
  number,
  labels: ["foo", "bar"]
});
// now sends `["foo", "bar"]` in the request body, instead of `{"labels": ["foo", "bar"]}`
```

## API docs

See the `README.md` files in the `ghe-*` folders for a list of available endpoint methods for the respective GitHub Enterprise version.

## How it works

The route definitions for the currently supported GitHub Enterprise versions are build automatically from [`@octokit/routes`](https://github.com/octokit/routes). Each time there is a new `@octokit/routes` release, [Greenkeeper](https://greenkeeper.io/) will send a pull request which updates the dependency in `package.json` and `package-lock.json`. That kicks of a build on Travis CI where the `greenkeeper-routes-update` script is run. If there is a change, the script updates the `*.json` definition files in the pull request.

## LICENSE

[MIT](LICENSE)

---
_Source: https://npm.io/package/@octokit/plugin-enterprise-rest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
