Skip to content

[snack-sdk][website][snackager] Migrate API server hostname#684

Merged
byronkarlen merged 4 commits into
mainfrom
byron/_snack-sdk_website_snackager_migrate_api_server_hostname
May 20, 2026
Merged

[snack-sdk][website][snackager] Migrate API server hostname#684
byronkarlen merged 4 commits into
mainfrom
byron/_snack-sdk_website_snackager_migrate_api_server_hostname

Conversation

@byronkarlen
Copy link
Copy Markdown
Contributor

@byronkarlen byronkarlen commented May 8, 2026

Why

For cookie-based auth to work, the API server url needs to be updated from exp.host to api.expo.dev (which shares the top-level domain with snack.expo.dev). api.expo.dev accepts requests in a different format than exp.host.

How

snack-sdk

  • Changed default apiUrl to api.expo.dev
  • Use the modern path format
  • Updated docs since this is a breaking change

snack-proxies

  • removed www from snack-proxies. No longer used. Instead, snack website runs against proxy-staging-api.expo.test, but this can be overriden with API_SERVER_URL

snackager

  • passes new api server url to snack-sdk

website

  • passes new api server url to snack-sdk
  • updates its own API requests

Test Plan

Used snack.expo.test locally and verified that thing worked as expected, but we don't have e2e test coverage for this.

Copy link
Copy Markdown
Contributor Author

byronkarlen commented May 8, 2026

@byronkarlen byronkarlen changed the title [snack-sdk] Migrate API server hostname [snack-sdk][website] Migrate API server hostname May 8, 2026
@byronkarlen byronkarlen changed the title [snack-sdk][website] Migrate API server hostname [snack-sdk][website][snackager] Migrate API server hostname May 8, 2026
@byronkarlen byronkarlen force-pushed the byron/_website_read_local_expo_auth_cookie_in_development branch from 7e05465 to f7a23fe Compare May 8, 2026 23:00
@byronkarlen byronkarlen force-pushed the byron/_snack-sdk_website_snackager_migrate_api_server_hostname branch from d6e1968 to add7f33 Compare May 8, 2026 23:00
@byronkarlen byronkarlen marked this pull request as ready for review May 8, 2026 23:51
@byronkarlen byronkarlen requested a review from byCedric as a code owner May 8, 2026 23:51
@byronkarlen byronkarlen requested a review from ide May 8, 2026 23:52
Comment thread snackager/src/__e2e__/__snapshots__/git.test.ts.snap Outdated
Comment thread packages/snack-sdk/src/WantedVersions.ts Outdated
Comment thread website/README.md Outdated
@byronkarlen byronkarlen force-pushed the byron/_website_read_local_expo_auth_cookie_in_development branch from f7a23fe to e4b4a3a Compare May 11, 2026 00:45
@byronkarlen byronkarlen force-pushed the byron/_snack-sdk_website_snackager_migrate_api_server_hostname branch from add7f33 to a4eba5b Compare May 11, 2026 00:45
@byronkarlen byronkarlen changed the base branch from byron/_website_read_local_expo_auth_cookie_in_development to graphite-base/684 May 11, 2026 15:39
@byronkarlen byronkarlen force-pushed the byron/_snack-sdk_website_snackager_migrate_api_server_hostname branch from a4eba5b to 87fd82b Compare May 11, 2026 15:40
@byronkarlen byronkarlen changed the base branch from graphite-base/684 to byron/tsconfig_and_eslint_cleanup May 11, 2026 15:40
@byronkarlen byronkarlen force-pushed the byron/tsconfig_and_eslint_cleanup branch from 5fbee17 to 12fcfeb Compare May 11, 2026 16:26
@byronkarlen byronkarlen force-pushed the byron/_snack-sdk_website_snackager_migrate_api_server_hostname branch from 87fd82b to 0d0006d Compare May 11, 2026 16:27
@byronkarlen byronkarlen force-pushed the byron/tsconfig_and_eslint_cleanup branch 2 times, most recently from 711ee44 to 07f3029 Compare May 11, 2026 16:35
@byronkarlen byronkarlen force-pushed the byron/_snack-sdk_website_snackager_migrate_api_server_hostname branch from 0d0006d to dd8021d Compare May 11, 2026 16:35
@byronkarlen byronkarlen force-pushed the byron/tsconfig_and_eslint_cleanup branch from 07f3029 to c81b819 Compare May 11, 2026 17:26
@byronkarlen byronkarlen force-pushed the byron/_snack-sdk_website_snackager_migrate_api_server_hostname branch from dd8021d to 716cdc7 Compare May 11, 2026 17:26
],
},
"url": "https://exp.host/--/api/v2/development-sessions/notify-close?deviceId=1234",
"url": "https://exp.host/v2/development-sessions/notify-close?deviceId=1234",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shoudl be api.expo.dev

@byronkarlen byronkarlen force-pushed the byron/_snack-sdk_website_snackager_migrate_api_server_hostname branch from 716cdc7 to 065b7a7 Compare May 12, 2026 18:43
@byronkarlen byronkarlen force-pushed the byron/tsconfig_and_eslint_cleanup branch from c81b819 to 012c054 Compare May 12, 2026 18:43
@byronkarlen byronkarlen requested a review from byCedric May 13, 2026 00:55
}
const id = match[2];
const response = await fetch(`https://exp.host/--/api/v2/snack/${id}`, {
const response = await fetch(`https://api.expo.dev/v2/snack/${id}`, {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any reason we don't use ${process.env.API_SERVER_URL}/v2/snack here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this component is meant to always hit the production api server even when API_SERVER_URL is something else during local dev

@byronkarlen byronkarlen changed the base branch from byron/tsconfig_and_eslint_cleanup to graphite-base/684 May 18, 2026 20:19
@byronkarlen byronkarlen force-pushed the byron/_snack-sdk_website_snackager_migrate_api_server_hostname branch from 065b7a7 to 9a2aa15 Compare May 18, 2026 20:19
@byronkarlen byronkarlen changed the base branch from graphite-base/684 to main May 18, 2026 20:19
@byronkarlen byronkarlen merged commit 6d33ea8 into main May 20, 2026
23 of 45 checks passed
@byronkarlen byronkarlen deleted the byron/_snack-sdk_website_snackager_migrate_api_server_hostname branch May 20, 2026 18:37
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.

3 participants