# app.js > GitHub App toolset for Node.js [](https://www.npmjs.com/package/@octokit/app) [](https://github.com/octokit/app.js/actions?workflow=Test) - [Usage](#usage) - [`App.defaults(options)`](#appdefaultsoptions) - [Constructor](#constructor) - [API](#api) - [`app.octokit`](#appoctokit) - [`app.log`](#applog) - [`app.getInstallationOctokit`](#appgetinstallationoctokit) - [`app.eachInstallation`](#appeachinstallation) - [`app.eachRepository`](#appeachrepository) - [`app.getInstallationUrl`](#appgetinstallationurl) - [`app.webhooks`](#appwebhooks) - [`app.oauth`](#appoauth) - [Middlewares](#middlewares) - [`createNodeMiddleware(app, options)`](#createnodemiddlewareapp-options) - [Contributing](#contributing) - [License](#license) ## Usage
| Browsers | `@octokit/app` is not meant for browser usage. |
|---|---|
| Node | Install with `npm install @octokit/app` ```js const { App, createNodeMiddleware } = require("@octokit/app"); ``` |
| name | type | description |
|---|---|---|
appId
|
number
|
Required. Find the App ID on the app’s about page in settings. |
privateKey
|
string
|
Required. Content of the *.pem file you downloaded from the app’s about page. You can generate a new private key if needed.
|
Octokit
|
Constructor
|
You can pass in your own Octokit constructor with custom defaults and plugins. Note that `authStrategy` will be always be set to `createAppAuth` from [`@octokit/auth-app`](https://github.com/octokit/auth-app.js). For usage with enterprise, set `baseUrl` to the hostname + `/api/v3`. Example: ```js const { Octokit } = require("@octokit/core"); new App({ appId: 123, privateKey: "-----BEGIN PRIVATE KEY-----\n...", oauth: { clientId: 123, clientSecret: "secret", }, webhooks: { secret: "secret", }, Octokit: Octokit.defaults({ baseUrl: "https://ghe.my-company.com/api/v3", }), }); ``` Defaults to [`@octokit/core`](https://github.com/octokit/core.js). |
log
|
object
|
Used for internal logging. Defaults to console.
|
webhooks.secret
|
string
|
Required. Secret as configured in the GitHub App's settings. |
webhooks.transform
|
function
|
Only relevant for `app.webhooks.on`. Transform emitted event before calling handlers. Can be asynchronous. |
oauth.clientId
|
number
|
Find the OAuth Client ID on the app’s about page in settings. |
oauth.clientSecret
|
number
|
Find the OAuth Client Secret on the app’s about page in settings. |
oauth.allowSignup
|
boolean
|
Sets the default value for app.oauth.getAuthorizationUrl(options).
|
| name | type | description |
|---|---|---|
app
|
App instance
|
Required. |
options.pathPrefix
|
string
|
All exposed paths will be prefixed with the provided prefix. Defaults to `"/api/github"` |
log
object
|
Used for internal logging. Defaults to [`console`](https://developer.mozilla.org/en-US/docs/Web/API/console) with `debug` and `info` doing nothing. |