Skip to main content
The GitHub entitlement adds a paying customer as a collaborator on a private repository. You choose the permission level (pull, push, triage, maintain, or admin). Dodo Payments sends the collaborator invitation and removes the collaborator when the grant is revoked.

What Gets Delivered

  • The customer connects their GitHub account from the Customer Portal. This links their GitHub account to the purchase.
  • Dodo Payments invites that account to your repository at the configured permission level. The customer gets access after they accept the invitation on GitHub. If the customer owns the repository, no invitation is needed.
  • Cancellation, refund, or a manual revoke removes the collaborator and cancels any pending invitation.
Common uses include source-available products, paid templates, course code repositories, and gated client SDKs.

Connect GitHub

1

Open Entitlements

In the Dodo Payments dashboard, go to Entitlements and click + to start a new entitlement.
2

Pick GitHub

Choose GitHub Access as the integration. If GitHub isn’t connected yet, click Connect GitHub.
New entitlement panel prompting the merchant to connect GitHub

Connect GitHub prompt before the install handoff.

GitHub opens in a new tab. Sign in, then install the Dodo Payments GitHub App on the organization or user account that owns the repository. You can grant the app access to All repositories or Only select repositories. If you select repositories, include every repository you intend to gate.
GitHub Install and Authorize page with All repositories and Only select repositories options

GitHub Install & Authorize page. Choose which repositories the app can manage.

When GitHub redirects back, a confirmation page shows that the account is connected.
GitHub Access connected successfully confirmation page

Account connected. Return to the Dodo Payments dashboard to continue.

3

Pick a Repository and Permission

Back in the dashboard, select the Repository the entitlement grants access to, then select the Permission level. The repository picker lists only repositories the GitHub App can access. Enter a Name for the entitlement and click Create Entitlement.
GitHub entitlement form with connected GitHub Access, repository selector, permission dropdown, and name field

Creating a GitHub entitlement. Pick the repository and the permission you want customers to receive.

4

Attach It to a Product

Attach the entitlement to any product. Customers who buy that product receive a GitHub invitation after they connect their GitHub account.

Permission Levels

The entitlement uses GitHub’s standard repository permissions:
Grant the least privilege that fits your use case. Most paid-content products need only pull.

Customer Flow

  1. 顧客がチェックアウトを完了します。
  2. Dodo Payments は Pending ステータスで grant を作成します。Dodo Payments は直ちに GitHub authorization URL の作成を試み、oauth_url に保存します。失敗した場合、顧客が accept flow を開始するまで oauth_url は null のままです。
  3. payment confirmation email には entitlement が Action Required として表示され、Customer Portal へのリンクが含まれます。ポータルで顧客が Connect をクリックし、GitHub で認証します。authorization link の有効期限は 30 分で、顧客が戻ってくると Customer Portal が新しいリンクを生成します。
  4. Dodo Payments は、設定された permission で顧客の GitHub アカウントを repository に招待します。invitation が作成されると、grant は Delivered に移行します。GitHub が invitation を拒否した場合、grant は提供されません。
  5. subscription がキャンセルされた場合、payment が返金された場合、または grant が取り消された場合、Dodo Payments は顧客を collaborator から削除し、保留中の invitation をキャンセルします。

Required Configuration

Create via API

Webhooks

The standard entitlement_grant.* webhook events cover the GitHub flow:
  • entitlement_grant.created は status: "Pending" とともに発火します。oauth_url には、すでに GitHub authorization URL が格納されている場合があります。null の場合、顧客が Customer Portal から accept flow を開始すると値が設定されます。
  • entitlement_grant.delivered は、collaborator invitation が作成されると発火します。
  • entitlement_grant.revoked は、access が取り消されたときに発火します。GitHub App をアンインストールすると、Dodo Payments は revocation_reason: platform_external を使用して、その installation に関連する保留中および提供済みの grant を取り消します。
  • Dodo Payments が顧客を repository に追加できない場合(たとえば、GitHub App が repository への access を失った場合)、entitlement_grant.failed は error_code: "GRANT_ACCESS_FAILED" とともに発火します。

Troubleshooting

Dodo Payments GitHub App は、repository を所有する organization または user にインストールする必要があります。entitlement form で GitHub card の Disconnect をクリックし、次に Connect GitHub をクリックして app を再インストールし、アクセスを制限する対象の repository への access を付与します。
The GitHub App’s installation no longer has access to the repository, or the repository was renamed or transferred. Grant the app access to the repository again, and the next regrant succeeds.
Customers accept the GitHub invitation from their GitHub notifications or from the link in GitHub’s invitation email. Until they accept, they’re invited but can’t clone the repository. The grant is still Delivered in Dodo Payments, because the invitation is what Dodo Payments issues.
最終更新日 2026年9月26日