feat(heygen): add HeyGen OAuth 2.0 emulator#42
Open
miguel-heygen wants to merge 1 commit intovercel-labs:mainfrom
Open
feat(heygen): add HeyGen OAuth 2.0 emulator#42miguel-heygen wants to merge 1 commit intovercel-labs:mainfrom
miguel-heygen wants to merge 1 commit intovercel-labs:mainfrom
Conversation
Contributor
|
@miguel-heygen is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
bd2efec to
b8cd0c7
Compare
Implements a full OAuth 2.0 authorization code flow with PKCE support for local HeyGen auth testing, following the same pattern as the existing Google and Microsoft providers. Routes: - GET /oauth/authorize: user-picker UI - POST /oauth/authorize/callback: issues code and redirects - POST /oauth/token: code exchange and refresh token grant with PKCE validation - GET /oauth/userinfo: returns both OIDC-standard (sub, name, picture) and HeyGen-specific aliases (user_id, full_name, avatar_url) Includes seed config support for users and OAuth clients, docs page, skills file, README entry, and navigation updates.
b8cd0c7 to
ec76d5c
Compare
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.
Summary
Adds a new
@emulators/heygenpackage implementing HeyGen's OAuth 2.0 authorization code flow with mandatory PKCE, matching HeyGen's production API shape.Why HeyGen? HeyGen uses a custom OAuth2 server split across two hosts (
app.heygen.comfor authorize,api2.heygen.comfor token/user endpoints) with a non-standard response wrapper ({ code: 100, data, message }) on the user endpoint. This emulator lets apps built on HeyGen auth test their full login flow locally without hitting production.Routes
GET/oauth/authorizePOST/oauth/authorize/callbackPOST/v1/oauth/tokenPOST/v1/oauth/refresh_tokenGET/v1/user/me{ code, data, message }wrapperMatches production behavior
client_secretrequired in token exchange (public client flow)/v1/oauth/refresh_token, not the same as the token endpoint/v1/user/meresponse wrapped in{ code: 100, data: { user: { user_id, email, username } }, message: "Success" }expires_in: 864000(10 days) matching real HeyGen token lifetimeredirect_urivalidation on token exchange per RFC 6749 §4.1.3Verified working
Tested end-to-end with a Next.js app using PKCE: redirect to emulator → user-picker → callback → token exchange → refresh →
/v1/user/me→ authenticated session.Changes
packages/@emulators/heygen/— full OAuth2 + PKCE implementationpackages/emulate/src/registry.ts— service registration withinitConfigdefaultsskills/heygen/SKILL.md— agent skill docsapps/web/app/heygen/— docs pageREADME.md— port listing and auth notes