About apps

You can build integrations with the GitHub Enterprise Server APIs to add flexibility and reduce friction in your own workflow.

Apps on GitHub allow you to automate and improve your workflow. You can build apps to improve your workflow.

Las GitHub Apps son la forma oficial y recomendada de integrarse con GitHub, ya que ofrecen permisos mucho más granulares para acceder a los datos, but GitHub supports both OAuth Apps and GitHub Apps. For information on choosing a type of app, see "Differences between GitHub Apps and OAuth Apps."

For a walkthrough of the process of building a GitHub App, see "Building Your First GitHub App."

About GitHub Apps

GitHub Apps are first-class actors within GitHub. A GitHub App acts on its own behalf, taking actions via the API directly using its own identity, which means you don't need to maintain a bot or service account as a separate user.

GitHub Apps can be installed directly on organizations and user accounts and granted access to specific repositories. They come with built-in webhooks and narrow, specific permissions. When you set up your GitHub App, you can select the repositories you want it to access. For example, you can set up an app called MyGitHub that writes issues in the octocat repository and only the octocat repository. To install a GitHub App, you must be an organization owner or have admin permissions in a repository.

Predeterminadamente, solo los propietarios de la organización pueden administrar los ajustes de las GitHub Apps en una organización. Para agregar usuarios adicionales para que administren las GitHub Apps en una organización, un propietario puede otorgarles permisos de administrador sobe ellas. Consula la sección "Administradores de GitHub Apps" para aprender cómo agregar y eliminar administradores de GitHub Apps en tu organización.

GitHub Apps are applications that need to be hosted somewhere. For step-by-step instructions that cover servers and hosting, see "Building Your First GitHub App."

To improve your workflow, you can create a GitHub App that contains multiple scripts or an entire application, and then connect that app to many other tools. For example, you can connect GitHub Apps to GitHub, Slack, other in-house apps you may have, email programs, or other APIs.

Keep these ideas in mind when creating GitHub Apps:

  • A GitHub App should take actions independent of a user (unless the app is using a user-to-server token). Para mantener más seguros los tokens de acceso de usuario a servidor, puedes utilizar tokens de acceso que caducarán después de 8 horas, y un token de actualización que se puede intercambiar por un token de acceso nuevo. Para obtener más información, consulta la sección "Actualizar los tokens de acceso de usuario a servidor".

  • Make sure the GitHub App integrates with specific repositories.

  • The GitHub App should connect to a personal account or an organization.

  • Don't expect the GitHub App to know and do everything a user can.

  • Don't use a GitHub App if you just need a "Login with GitHub" service. But a GitHub App can use a user identification flow to log users in and do other things.

  • Don't build a GitHub App if you only want to act as a GitHub user and do everything that user can do.

To begin developing GitHub Apps, start with "Creating a GitHub App."

About OAuth Apps

OAuth2 is a protocol that lets external applications request authorization to private details in a user's GitHub account without accessing their password. This is preferred over Basic Authentication because tokens can be limited to specific types of data and can be revoked by users at any time.

Advertencia: Si revocas todos los permisos de una App OAuth borrarás cualquier llave SSH que haya generado la aplicación en nombre del usuario, , incluyendo las llaves de despliegue.

An App OAuth uses GitHub as an identity provider to authenticate as the user who grants access to the app. This means when a user grants an App OAuth access, they grant permissions to all repositories they have access to in their account, and also to any organizations they belong to that haven't blocked third-party access.

Building an App OAuth is a good option if you are creating more complex processes than a simple script can handle. Note that OAuth Apps are applications that need to be hosted somewhere.

Keep these ideas in mind when creating OAuth Apps:

  • An App OAuth should always act as the authenticated GitHub user across all of GitHub (for example, when providing user notifications).
  • An App OAuth can be used as an identity provider by enabling a "Login with GitHub" for the authenticated user.
  • Don't build an App OAuth if you want your application to act on a single repository. With the repo OAuth scope, OAuth Apps can act on all of the authenticated user's repositories.
  • Don't build an App OAuth to act as an application for your team or company. OAuth Apps authenticate as a single user, so if one person creates an App OAuth for a company to use, and then they leave the company, no one else will have access to it.

For more on OAuth Apps, see "Creating an App OAuth" and "Registering your app."

Personal access tokens

A personal access token is a string of characters that functions similarly to an OAuth token in that you can specify its permissions via scopes. A personal access token is also similar to a password, but you can have many of them and you can revoke access to each one at any time.

As an example, you can enable a personal access token to write to your repositories. If then you run a cURL command or write a script that creates an issue in your repository, you would pass the personal access token to authenticate. You can store the personal access token as an environment variable to avoid typing it every time you use it.

Keep these ideas in mind when using personal access tokens:

  • Remember to use this token to represent yourself only.
  • You can perform one-off cURL requests.
  • You can run personal scripts.
  • Don't set up a script for your whole team or company to use.
  • Don't set up a shared user account to act as a bot user.

Determining which integration to build

Before you get started creating integrations, you need to determine the best way to access, authenticate, and interact with the GitHub Enterprise Server APIs. The following image offers some questions to ask yourself when deciding whether to use personal access tokens, GitHub Apps, or OAuth Apps for your integration.

Intro to apps question flow

Consider these questions about how your integration needs to behave and what it needs to access:

  • Will my integration act only as me, or will it act more like an application?
  • Do I want it to act independently of me as its own entity?
  • Will it access everything that I can access, or do I want to limit its access?
  • Is it simple or complex? For example, personal access tokens are good for simple scripts and cURLs, whereas an App OAuth can handle more complex scripting.

Requesting support

Para las preguntas, reportes de errores y debates sobre las GitHub Apps, OAuth Apps y el desarrollo de la API, explora el Foro de desarrollo y soporte de la API de GitHub. El foro se modera y mantiene con el personal de GitHub, pero no se garantiza que el personal de GitHub responda las preguntas que se publiquen en el mismo.

Considera contactar al Soporte de GitHub directamente utilizando el formato de contacto para:

  • respuestas garantizadas del personal de GitHub Enterprise Server
  • solicitudes de soporte que involucren preocupaciones sobre datos sensibles o privados
  • solicitudes de características
  • retroalimentación sobre los productos de GitHub Enterprise Server

¿Te ayudó este documento?

Política de privacidad

¡Ayúdanos a hacer geniales estos documentos!

Todos los documentos de GitHub son de código abierto. ¿Notas algo que esté mal o que no sea claro? Emite una solicitud de cambios.

Haz una contribución

O, aprende cómo contribuir.