Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions contents/docs/cdp/sources/_snippets/source-github.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ To link GitHub:

2. Click **+ New source** and then click **Link** next to GitHub.

3. Next, you need a personal access token from GitHub. Go to your [personal access tokens settings](https://github.com/settings/tokens) in GitHub. Click **Generate new token**, give it a name, select the required scopes (at minimum `repo` for private repositories or `public_repo` for public repositories), and copy the value of the newly created token.
3. Select your **Authentication type**. OAuth is the default and recommended method:

4. Back in PostHog, paste the personal access token in the `Personal access token` field and enter the repository in the format `owner/repo` (e.g., `posthog/posthog`). Click **Next**.
- **OAuth (GitHub App)** – Click the GitHub account field and follow the prompts to connect your GitHub account. This handles authentication automatically.

- **Personal access token** – If you prefer using a PAT, select this option. Go to your [personal access tokens settings](https://github.com/settings/tokens) in GitHub, click **Generate new token**, give it a name, select the required scopes (`repo` for private repositories or `public_repo` for public repositories), and paste the token into PostHog.

5. On the next page, set up the schemas you want to sync and modify the method and frequency as needed. Once done, click **Import**.
4. Enter the repository you want to sync in the format `owner/repo` (e.g., `posthog/posthog`). Click **Next**.

5. Set up the schemas you want to sync and modify the method and frequency as needed. Once done, click **Import**.

Once the syncs are complete, you can start using GitHub data in PostHog.

Expand Down