Deployment and client configuration for T3 Connect. See T3 Connect for trust boundaries and infra/relay/README.md for relay provisioning.
T3 Connect is disabled in a fresh clone. Copy .env.example to .env for production, or set these public identifiers in .env / .env.local (process env > .env.local > .env):
T3CODE_CLERK_PUBLISHABLE_KEY=<publishable key>
T3CODE_CLERK_JWT_TEMPLATE=<JWT template name>
T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=<public OAuth application client ID>
T3CODE_RELAY_URL=https://relay.example.comCLERK_SECRET_KEY belongs only in relay secrets, never in client config. Client and bundled-server builds embed these values at build time; EAS preview/production environments need the publishable key, JWT template, and relay URL.
Create a public OAuth application in Clerk (authorization code + PKCE):
- Redirect URI:
http://127.0.0.1:34338/callback - Scopes:
openid,profile,email,offline_access - Enable Device authorization grant (required for headless/SSH login; Clerk enables it per account on request).
- Set
T3CODE_CLERK_CLI_OAUTH_CLIENT_IDto its public client ID.
Create a Clerk JWT template named t3-relay with { "aud": "t3-code-relay" }. Set T3CODE_CLERK_JWT_TEMPLATE=t3-relay on clients and CLERK_JWT_AUDIENCE=t3-code-relay on the relay.
Enable Clerk's Native API, add t3code-dev://app/ and t3code://app/ to the SSO redirect allowlist, and add t3code-dev://app and t3code://app to allowed_origins via PATCH https://api.clerk.com/v1/instance (preserving existing entries).
In Clerk Native applications > Allowlist for mobile SSO redirect, allow each variant's callback:
| Variant | Callback |
|---|---|
| Development | clerk://com.t3tools.t3code.dev.callback |
| Preview | clerk://com.t3tools.t3code.preview.callback |
| Production | clerk://com.t3tools.t3code.callback |
Use Clerk's allowlist or Restricted mode for new sign-ups (an enabled empty allowlist blocks all sign-ups). Ban the account in Clerk to revoke existing sessions.
The relay sends Android push notifications directly via FCM HTTP v1 (no Expo Push account required):
- Register each Android package (
com.t3tools.t3code.{dev,preview}/com.t3tools.t3code) in Firebase and downloadgoogle-services.json. - Pass
T3CODE_ANDROID_GOOGLE_SERVICES_FILE=/abs/path/google-services.jsonwhen prebuilding/building locally or as an EAS file variable (available to fingerprint generation as well). - Enable the FCM API and store the Firebase service-account JSON only in the relay's
FCM_SERVICE_ACCOUNTsecret (never in EAS app env or the repo). SetAPNS_ENABLED=falsefor an Android-only relay stage. - For local smoke/watch verification without deploying a relay, use
vp run push:android:smokeandvp run push:android:watchfrominfra/relay.
For a signed macOS build (com.t3tools.t3code):
- Create an explicit macOS App ID with Associated Domains and a matching distribution provisioning profile.
- In Clerk Native API settings, add an iOS app with the same Apple Team ID and bundle ID, and verify
https://<frontend-api>/.well-known/apple-app-site-associationincludes<TEAM_ID>.com.t3tools.t3code. - Configure signing per Apple signing and notarization. Local signed builds use
T3CODE_APPLE_TEAM_ID,T3CODE_MACOS_PROVISIONING_PROFILE, and optionallyT3CODE_CLERK_PASSKEY_RP_DOMAINS. Bump the build version after changing Associated Domains so macOS refreshes cached Shared Web Credentials.
Unsigned dev:desktop cannot exercise passkeys. For renderer HMR with passkeys, launch an installed signed build against vp run dev:web:
VITE_DEV_SERVER_URL=http://127.0.0.1:5733 T3CODE_PORT=13773 \
"/Applications/T3 Code (Alpha).app/Contents/MacOS/T3 Code (Alpha)"