> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lovable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect your app to GitHub API

> Connect your app to GitHub with a personal access token to read repositories, manage issues and pull requests, and build automations with the GitHub REST API.

export const connector_0 = "GitHub"

[GitHub](https://github.com/) hosts repositories, issues, pull requests, and CI workflows for engineering teams. The GitHub connector lets your Lovable app call the [GitHub REST API](https://docs.github.com/en/rest) using a personal access token from your GitHub account. It is designed for apps that read or update GitHub data from server code, such as issue dashboards, PR trackers, and automation workflows.

With GitHub, your app can:

* List and read repositories, branches, and file contents
* Create and update issues and pull requests
* Read commits, releases, and workflow runs
* Build internal tools and automations on top of GitHub data

<Note>
  This is a connector for apps you build with Lovable. Your app can call the GitHub REST API to read and update repositories, issues, pull requests, and other GitHub data.
  Want to export or two-way sync your Lovable project code to GitHub instead? Use [GitHub Git sync](/integrations/github).
</Note>

## Common use cases and example apps

| Example app                  | Example prompt                                                                                          | Description                                                                                                                                                 |
| :--------------------------- | :------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Issue triage board           | *Use GitHub and build a dashboard that lists open issues across my repositories, grouped by label.*     | **Surface open work without leaving your app.**<br />The app reads issues from GitHub and presents them in a filterable board.                              |
| PR status hub                | *Use GitHub and build a page that shows open pull requests with review status and age.*                 | **Give managers a live view of in-flight code review.**<br />The app fetches pull requests and highlights stale or blocked reviews.                         |
| Release tracker              | *Use GitHub and build a tool that lists recent releases and workflow results for our main repos.*       | **Track shipping activity from GitHub data.**<br />The app combines release and Actions metadata in one view.                                               |
| Repo health dashboard        | *Use GitHub and build an admin page that shows repository stats and open issue counts.*                 | **Monitor repository health at a glance.**<br />The app aggregates GitHub API responses into summary cards.                                                 |
| Automation webhook companion | *Use GitHub and build a server endpoint that creates an issue when a form is submitted.*                | **Turn app events into GitHub issues automatically.**<br />The app validates input and calls the GitHub REST API through the connector gateway.             |
| Contributor activity feed    | *Use GitHub and build a page that shows recent commits and pull requests across our team repositories.* | **Give stakeholders a single view of recent engineering activity.**<br />The app fetches commits and pull requests and groups them by repository or author. |

## How to connect GitHub

Workspace **admins** and **owners** can connect GitHub.

You can create multiple GitHub connections using different personal access tokens, which is useful for separating environments (for example, development and production) or using tokens with different permission scopes.

When the connection is created, GitHub becomes available across all projects in the workspace. Anyone building in a project can ask Lovable in chat to link their project to it.

### Prerequisites

Before connecting GitHub, make sure you have:

* A GitHub account
* A [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with permissions that match the endpoints your app will call
* Lovable workspace **owner** or **admin** role

<Note>
  API requests made through this connector count toward your GitHub account rate limits. Quotas and billing are handled by GitHub, not Lovable.
</Note>

### Step 1: Create a GitHub personal access token

A personal access token lets your Lovable app authenticate with the GitHub REST API on your behalf.

To create a GitHub personal access token:

<Steps>
  <Step title="Open GitHub token settings">
    Sign in to [GitHub](https://github.com/) and open [Settings → Developer settings → Personal access tokens](https://github.com/settings/tokens).
  </Step>

  <Step title="Generate a token">
    Create a **fine-grained** or **classic** token. Fine-grained tokens can be limited to specific repositories. Classic tokens use scope lists such as `repo` or `public_repo`.
  </Step>

  <Step title="Select permissions">
    Grant only the permissions your app needs. For private repositories, include repository read or write access. For public data only, `public_repo` may be enough on classic tokens.
  </Step>

  <Step title="Copy the token">
    Copy the token when GitHub shows it. You will not be able to view it again.
  </Step>
</Steps>

<Warning>
  Your personal access token functions like a password. Keep it secure and never share it publicly. You will need it in the next step.
</Warning>

See GitHub documentation for more: [Managing personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).

### Step 2: Connect GitHub to Lovable

You can create multiple connections using different personal access tokens.

<Steps>
  <Step title="Open GitHub in Connectors">
    Go to **Connectors → App connectors** and select **GitHub**.
  </Step>

  <Step title="Add a connection">
    Click **Add connection**.
  </Step>

  <Step title="Configure the connection">
    1. **Display name**: name the connection, for example `GitHub Prod`.
    2. **Personal access token**: paste the token you created in step 1.
  </Step>

  <Step title="Choose who can access this connection">
    Under **Who can access this connection**, decide who in your workspace can use the connection:

    * **Only you** (default): only the person creating the connection can use it and its associated data.
    * **Invite specific people**: only you and explicitly added workspace members can use the connection and its associated data.
    * **Invite entire workspace**: click **Invite entire workspace** to make the connection available to everyone in your Lovable workspace.

    See [Connection-level access](/integrations/introduction#connection-level-access) for more information.
  </Step>

  <Step title="Connect">
    Click **Connect**. Lovable verifies the token against the GitHub API before saving the connection.
  </Step>
</Steps>

When connected, anyone building in a project can ask Lovable in chat to link their project to GitHub (based on configured connection-level access). Your Lovable apps can then read and update repositories, issues, pull requests, and other GitHub resources through the connector gateway.

## Limitations

The GitHub connector cannot:

* Use OAuth app or GitHub App installation flows. Use a personal access token instead.
* Replace [GitHub Git sync](/integrations/github) for backing up or syncing your Lovable project codebase.
* Support per-end-user GitHub login. Each connection represents a single GitHub account shared across all projects linked to it.
* Call endpoints your token permissions do not cover. If a call returns `403`, update the token permissions or create a new token with broader scopes.

If you revoke the personal access token on GitHub, update the connection with a new token or create a new connection before API calls can succeed again.

## How to unlink projects from a {connector_0} connection

Editors and above can remove specific projects from a connection without deleting the connection entirely. The connection will remain available for other projects.

To unlink projects:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to manage.
  </Step>

  <Step title="Select projects">
    Under **Linked projects**, check the projects you want to unlink.
  </Step>

  <Step title="Confirm">
    Click **Unlink projects** and confirm.
  </Step>
</Steps>

When unlinked, those projects will no longer have access to {connector_0} through this connection. If a project needs {connector_0} again, you can link it to any available connection.

## How to delete a {connector_0} connection

Workspace admins and owners can delete {connector_0} connections. Other members can delete a connection if they created it, or if they have been explicitly granted access to it.

<Warning>
  Deleting a connection is permanent and cannot be undone. It will remove the credentials from all linked projects, and any apps using this connection will stop working until a new connection is added.
</Warning>

Before deleting, review the **Linked projects** section to see which projects are currently using the connection.

To delete a connection:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to remove.
  </Step>

  <Step title="Review linked projects">
    Review the **Linked projects** section.
  </Step>

  <Step title="Delete">
    Under **Delete this connection**, click **Delete** and confirm.
  </Step>
</Steps>
