GitHub repo sales

Sell private repos, premium templates, boilerplates, private SDKs, trading bots, and course repositories. The buyer pays in USDC, enters their GitHub username, and SettleKit invites them to the repo or team. When a subscription lapses, access is removed.

What you can sell

  • Private GitHub repo access
  • Premium open-source repo access
  • Paid starter templates and boilerplates
  • Private SDKs, AI agent code, and trading bots
  • Private SaaS templates and automation scripts
  • Private course / project repositories

Seller flow

  1. Connect GitHub and install the SettleKit GitHub App.
  2. Select a repo or an organization team to sell.
  3. Create a price: one-time, monthly, yearly, or lifetime.
  4. SettleKit creates a hosted checkout page.
  5. The buyer pays in USDC and enters their GitHub username.
  6. SettleKit invites the buyer to the repo / team.
  7. The buyer gets an access page plus a receipt.
  8. If a subscription expires, SettleKit removes access.

Buyer flow

  1. Open the checkout link.
  2. Pay 25 USDC.
  3. Enter a GitHub username.
  4. Accept the GitHub invite.
  5. Access the private repo and receive updates while active.

Granting access from a payment

After a payment is confirmed (see the Quickstart), grant the universal entitlement for a github_repo_access product. The entitlement is the record of truth; the GitHub invite is the delivery action that fulfills it.

grant the repo entitlementts
import {
  EntitlementService,
  InMemoryEntitlementRepository,
} from "@settlekit/entitlements";

const entitlements = new EntitlementService(
  new InMemoryEntitlementRepository(),
);

const entitlement = await entitlements.grantFromPayment({
  payment, // confirmed Payment from @settlekit/payments
  product: {
    id: "prod_repo_pro",
    merchantId: "mer_acme",
    organizationId: "org_acme",
    name: "Pro trading bot",
    description: "Private repo access",
    type: "github_repo_access",
    status: "active",
    deliveryMode: "github_invite",
    metadata: { repoOwner: "acme", repoName: "trading-bot" },
    createdAt: new Date().toISOString(),
    updatedAt: new Date().toISOString(),
  },
});

Inviting the buyer

Once you have the buyer's GitHub username, call grantGitHubRepoAccess from @settlekit/github. It invites the user as a collaborator and returns a GitHubRepoAccessGrant whose status is invited (a pending invitation) or active (the user already had access). The function is idempotent: a repeat call or an existing collaborator is treated as success.

invite the buyer as a collaboratorts
import { grantGitHubRepoAccess } from "@settlekit/github";
import type { GitHubAccessClient } from "@settlekit/github";

// client is your authenticated GitHub App client (one per installation).
declare const client: GitHubAccessClient;

const grant = await grantGitHubRepoAccess(client, {
  organizationId: "org_acme",
  installationId: 42_000_000,
  customerId: "cus_123",
  entitlementId: entitlement.id,
  repoOwner: "acme",
  repoName: "trading-bot",
  githubUsername: "buyer-handle",
  permission: "pull", // "pull" | "push" | "maintain"
});

console.log(grant.status); // "invited" | "active"
if (grant.status === "invited") {
  console.log(grant.invitationId); // pending invite id

When a subscription lapses, revoke access with the companion revokeGitHubRepoAccess helper and mark the entitlement revoked via entitlements.revoke(entitlementId, reason).

Next

Selling recurring access? Pair this with SaaS billing to drive the subscription lifecycle, or bundle a repo with other products in Bundles.