Skip to content

[eas-cli] Add Convex integration (eas convex:init)#3575

Draft
FiberJW wants to merge 5 commits intomainfrom
fiberjw/convex-integration
Draft

[eas-cli] Add Convex integration (eas convex:init)#3575
FiberJW wants to merge 5 commits intomainfrom
fiberjw/convex-integration

Conversation

@FiberJW
Copy link
Copy Markdown
Member

@FiberJW FiberJW commented Apr 6, 2026

Why

Expo is integrating with Convex to let users provision a Convex backend directly from the EAS CLI. This enables a streamlined onboarding flow where developers can set up a Convex team, project, and deployment without leaving their terminal or navigating through OAuth flows.

How

New command: eas convex:init

Sets up Convex for an Expo project in one command. The CLI talks to the EAS backend (www), which acts as an OAuth proxy to Convex APIs.

Flow:

  1. Checks if the user's EAS account already has a Convex team connection
  2. If not, prompts for deployment region and team name, then creates a Convex team via createConvexTeamConnection mutation
  3. Creates a Convex project + deployment via setupConvexProject mutation
  4. Sends a team invitation to the user's email via sendConvexTeamInvite
  5. Writes CONVEX_DEPLOY_KEY and EXPO_PUBLIC_CONVEX_URL to .env.local (merges with existing content)

Flags:

  • --region — Convex deployment region (aws-us-east-1, aws-eu-west-1)
  • --team-name — Name for the new Convex team
  • --project-name — Name for the Convex project
  • --non-interactive — Uses sensible defaults without prompting

All optional flags are prompted for interactively when omitted (unless --non-interactive).

Codegen parameterization

The generate-graphql-code npm script now supports a GRAPHQL_SCHEMA_URL env var so we can generate types from a local www server:

GRAPHQL_SCHEMA_URL=http://127.0.0.1:3000/graphql yarn generate-graphql-code

Falls back to https://staging-api.expo.dev/graphql (same as before).

New files

File Purpose
src/commands/convex/init.ts Main command
src/commands/convex/__tests__/init.test.ts 21 unit tests
src/commands/convex/E2E_TESTING.md Manual E2E testing guide (11 scenarios)
src/graphql/types/ConvexTeamConnection.ts GraphQL fragments
src/graphql/queries/ConvexQuery.ts Team connection query
src/graphql/mutations/ConvexMutation.ts Create team, setup project, send invite, delete team mutations

Modified files

File Change
graphql-codegen.yml Schema URL via env var
package.json Codegen script default + convex oclif topic
graphql.schema.json Updated schema with Convex types
src/graphql/generated.ts Regenerated types including Convex types

Test Plan

Unit tests (21 passing)

cd packages/eas-cli && yarn test src/commands/convex/__tests__/init.test.ts

Covers: team creation flow, existing connections, project name resolution, team invites (including non-fatal failures and robot actors), .env.local merging/overwriting, non-interactive mode, error handling.

E2E testing

See src/commands/convex/E2E_TESTING.md for the full manual testing guide with 11 scenarios. Summary:

# Build the CLI
yarn build

# Run against local www
EXPO_LOCAL=1 packages/eas-cli/bin/run convex:init

Typecheck / lint

yarn typecheck  # ✅ passes
yarn lint       # ✅ 0 errors (7 pre-existing warnings)

@expo expo deleted a comment from github-actions bot Apr 6, 2026
Add a new `convex:init` command that provisions a Convex backend for an
Expo project. The CLI talks to the EAS backend (www), which acts as an
OAuth proxy to Convex APIs.

The command flow:
- Checks for existing Convex team connections on the EAS account
- Creates a new Convex team if none exists (prompts for region + name)
- Sets up a Convex project and deployment
- Sends a team invitation to the user's email
- Writes CONVEX_DEPLOY_KEY and EXPO_PUBLIC_CONVEX_URL to .env.local

Also parameterizes the GraphQL codegen schema URL so it can target a
local www server: `GRAPHQL_SCHEMA_URL=http://127.0.0.1:3000/graphql yarn generate-graphql-code`
@FiberJW FiberJW force-pushed the fiberjw/convex-integration branch from 285cd73 to 3e962e3 Compare April 6, 2026 18:17
Copy link
Copy Markdown
Member Author

FiberJW commented Apr 6, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@FiberJW FiberJW force-pushed the fiberjw/convex-integration branch from 3e962e3 to 73e925f Compare April 6, 2026 18:48
@douglowder douglowder self-requested a review April 6, 2026 20:45
@@ -1,5 +1,5 @@
overwrite: true
schema: 'https://staging-api.expo.dev/graphql'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wish there were some way that graphql-codegen could use the actual correct Expo API URL in https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/api.ts#L78

FiberJW added 3 commits April 9, 2026 16:01
Allow users to specify which email to send the Convex team invite to,
with the current user's email suggested as the default. Adds
--invite-email flag for non-interactive use.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

✅ Thank you for adding the changelog entry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants