{"id":11587,"library":"probot","title":"Probot: GitHub App Framework","description":"Probot is a robust Node.js framework, currently at version 14.3.2, designed for building GitHub Apps to automate and enhance development workflows. It provides a streamlined, event-driven architecture that significantly simplifies interaction with the GitHub API and handling webhook events. Written in TypeScript, Probot ships with comprehensive type definitions, offering full support for TypeScript projects. The project maintains an active development and release cadence, with minor and patch versions frequently released (typically every few weeks) to deliver bug fixes, critical security updates (such as recent `yaml` dependency patches), and new features. Its primary differentiator is abstracting the complexities of GitHub App development, allowing developers to concentrate on core application logic rather than boilerplate API calls, authentication, or webhook infrastructure.","status":"active","version":"14.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/probot/probot","tags":["javascript","probot","github-apps","github","automation","robots","workflow","typescript"],"install":[{"cmd":"npm install probot","lang":"bash","label":"npm"},{"cmd":"yarn add probot","lang":"bash","label":"yarn"},{"cmd":"pnpm add probot","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for interacting with the GitHub API. Probot provides an authenticated Octokit client via `context.octokit`.","package":"@octokit/core","optional":false},{"reason":"Commonly used for local development to forward GitHub webhook payloads from a public URL to your local Probot app.","package":"smee-client","optional":true}],"imports":[{"note":"Probot v12+ is ESM-only. Use `import` statements; CommonJS `require` will result in an `ERR_REQUIRE_ESM` error.","wrong":"const Probot = require('probot');","symbol":"Probot","correct":"import { Probot } from 'probot';"},{"note":"This type is essential for defining the entry point of your Probot app when using TypeScript.","symbol":"ApplicationFunction","correct":"import { ApplicationFunction } from 'probot';"},{"note":"The `Context` type represents the webhook event payload and provides helpers for API interactions and logging within an event handler.","symbol":"Context","correct":"import { Context } from 'probot';"},{"note":"The recommended way to define your Probot app's entry point is using an ESM default export for the application function.","wrong":"module.exports = (app) => { /* ... */ };","symbol":"App Function Default Export","correct":"export default (app: Probot) => { /* ... */ };"}],"quickstart":{"code":"import { Probot } from 'probot';\n\nexport default (app: Probot) => {\n  app.on('issues.opened', async (context) => {\n    const issueComment = context.issue({\n      body: 'Thanks for opening this issue! We\\'ll take a look soon.',\n    });\n    return context.octokit.issues.createComment(issueComment);\n  });\n\n  app.on('pull_request.opened', async (context) => {\n    context.log.info(`New pull request opened: ${context.payload.pull_request.html_url}`);\n    const prComment = context.issue({\n      body: 'Welcome to the party, pull request! Feel free to ask questions if you get stuck.',\n    });\n    return context.octokit.issues.createComment(prComment);\n  });\n\n  app.onError(async (error) => {\n    app.log.error(`An error occurred: ${error.message}`);\n    // Optionally, send error details to a monitoring service\n    // console.error(error);\n  });\n\n  // Example of using an environment variable for configuration (optional)\n  const GREETING_MESSAGE = process.env.PROBOT_GREETING_MESSAGE ?? 'Hello from Probot!';\n  app.log.info(GREETING_MESSAGE);\n};\n","lang":"typescript","description":"This quickstart demonstrates a basic Probot app written in TypeScript, responding to new issue and pull request events by adding comments. It also includes error handling and shows how to log messages and use environment variables."},"warnings":[{"fix":"Migrate your app to use ES Modules (`import`/`export`) or stick to Probot v11 for CommonJS compatibility. Ensure your `package.json` specifies `\"type\": \"module\"` if using ESM.","message":"Probot v12 and newer are pure ESM packages. Using `require()` for importing Probot will result in `ERR_REQUIRE_ESM` errors.","severity":"breaking","affected_versions":">=12.0.0"},{"fix":"Upgrade your Node.js environment to a compatible version (e.g., Node.js 20.18.1 or Node.js 22).","message":"Probot requires Node.js version `^20.18.1 || >= 22`. Running with older Node.js versions will lead to startup failures or unexpected behavior.","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Consult the `@octokit/core` release notes for breaking changes and adapt your Octokit API calls accordingly. Always test your app after major `@octokit` dependency updates.","message":"Major version updates to the underlying `@octokit` monorepo (as seen in `v14.2.2`) can sometimes introduce breaking changes if your app directly interacts with `context.octokit` using patterns that have been deprecated or removed in newer Octokit versions.","severity":"breaking","affected_versions":">=14.2.2"},{"fix":"Review your environment variable loading strategy. If you rely on specific `dotenv` features (e.g., `.env.local` files, variable expansion), you might need to handle them manually or use a compatible alternative alongside Probot's native parsing.","message":"Starting from `v14.3.0`, Probot replaces `dotenv` with Node.js native `parseEnv` for environment variable parsing. While this generally provides a more native experience, ensure your Node.js version supports `parseEnv` fully and any custom `dotenv` configurations are migrated.","severity":"gotcha","affected_versions":">=14.3.0"},{"fix":"Regularly update your Probot package to the latest patch release (`npm update probot`) to ensure all known security vulnerabilities in its dependencies are addressed.","message":"Regular security updates for dependencies, such as the `yaml` dependency update in `v14.3.2`, are released to patch vulnerabilities. Failing to update can expose your Probot app to known security risks.","severity":"security","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Update your import statements to use ES Modules syntax: `import { Probot } from 'probot';`. Ensure your project's `package.json` has `\"type\": \"module\"` if you are using `.js` files as ESM, or rename your app files to `.mjs`.","cause":"Attempting to import Probot or its components using CommonJS `require()` syntax in a Node.js environment where Probot is treated as an ESM module.","error":"ERR_REQUIRE_ESM: require() of ES Module [path/to/probot] not supported. probot is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which declares it to be an ES module."},{"fix":"Ensure `PRIVATE_KEY` is set in your environment variables. It should contain the entire content of the `.pem` file downloaded from your GitHub App settings, including `-----BEGIN RSA PRIVATE KEY-----` and `-----END RSA PRIVATE KEY-----` headers/footers. Also, check that `APP_ID` is correctly set.","cause":"The `PRIVATE_KEY` environment variable is not set, or the provided key is malformed or expired. Probot needs a valid private key to authenticate with GitHub as an app.","error":"Error: GitHub App private key is missing or invalid."},{"fix":"Upgrade your Node.js environment to version `^20.18.1` or `>= 22` to match the requirements. Use a tool like `nvm` to manage Node.js versions efficiently.","cause":"Your current Node.js version does not meet Probot's `engines.node` requirement.","error":"Error: Node.js version x.y.z is not supported."},{"fix":"For local development, use `smee.io` (or similar) and set `WEBHOOK_PROXY_URL` to your Smee URL. For deployment, ensure your server is publicly accessible and the webhook URL in your GitHub App settings points to your deployed Probot app's `/api/github/webhooks` endpoint.","cause":"When running Probot locally without a tool like `smee.io`, or when deploying, the GitHub App's webhook URL is incorrectly configured or not publicly accessible.","error":"Error: Webhook callback URL is not configured or reachable."}],"ecosystem":"npm"}