Repository navigation
Conversation
…reads what it finds) An account GenClass makes a partner by hand (accounts.partner_apps, with the Enterprise grant) gets partner keys on /account and five server-to-server routes under /api/partner/v1: make the app for a user's ref (idempotent), list them, read one app's dashboard data and events, and hand that user a private dashboard link. Keys are gcp_ + 32 bytes, hashed, browser-made, no CORS; a key reaches its own account's apps only and stops when revoked or when the account stops being a partner. Nothing deletes an app. Migration 0023 (partner_apps, projects.partner_ref, partner_keys). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A partner API for products that set GenClass up for their own users (a coding-agent tool, a hosting or app-builder platform). The partner's server makes a GenClass app for each of its users, its agent puts the app's key in that user's code (
npx @genclass/runtime@beta init --token <key>, no sign-in needed), and it reads what the app finds. The partner's account carries the apps and their plan, so its users need no GenClass account.Who can use it. Only an account GenClass makes a partner by hand: the Enterprise grant plus
accounts.partner_apps, how many apps it may hold (README "Partner API" has the SQL). Without that, every partner route answers 403 and /account shows nothing new.Routes (
Authorization: Bearer gcp_..., server to server):POST /api/partner/v1/apps, body{ ref, name? }: makes the app for that user (201), or returns the one already made for that ref (200). Stops atpartner_appswith a 409.GET /api/partner/v1/apps?ref=&cursor=: the apps it made, 100 a page.GET /api/partner/v1/apps/<id>?range=: the app's dashboard as data, the same answer and plan rules as/api/cli/app, now shared throughappView.GET /api/partner/v1/apps/<id>/events: the existing export (exportFor).POST /api/partner/v1/apps/<id>/link: a private dashboard link to hand that user. The previous link stops working./api/account/partner-keys: the browser session on genclass.dev makes, lists and revokes up to 10 keys. A new "Partner API" section in /account settings does this, and shows a key only once.Rules:
EXPORT_LIMIT, bucketpartner).partner_ref.Migration 0023 (additive):
accounts.partner_apps,projects.partner_refwith a partial unique index on (account, ref), and thepartner_keystable. It must be applied before deploying.PRIVACY.md gets a short "Partners" section: a partner reads the apps it made as any account reads its own. Who receives an app's data is the owner's call, so it needs the owner's OK.
Tests and checks:
test/partner.test.ts(8 tests)./api/cli/appnow goes through the sharedappView.tsc --stricton the worker is clean.wrangler dev, I made a key in /account, then via curl: created an app (and got the same app for a repeated ref), sent it a batch, and read its view (no CORS headers), list, events and private link.Not done here, and each needs the owner: merging, applying 0023 in production, deploying, and making the first partner account.
🤖 Generated with Claude Code