Publish your user's DeepSpace web app as an iPhone and Android app: App Store and Google Play steps
Turn a DeepSpace web app into an iPhone and Android app on the same data and sign-in: add the Expo client with npx deepspace add mobile, allow its sign-in callback, build with EAS, upload iOS builds to TestFlight, and what needs the person's developer accounts.
On this page
Yes, a DeepSpace web app can get an iPhone and Android app that uses the same data, sign-in and permissions. npx deepspace add mobile adds an Expo (React Native) client to the app. It talks to the same Worker as the website, so a record saved on the phone appears on the website and the other way round. You can build it, run it in the iOS Simulator or an Android emulator, and upload iOS builds to TestFlight with npx deepspace testflight.
Publishing in the App Store and Google Play needs the person's own Apple and Google developer accounts. Creating those, paying their fees, accepting their agreements and submitting for store review are the person's steps.
Version: written for deepspace@0.43.0 (changelog). Docs checked: October 29, 2026. npx deepspace add mobile was run on October 29, 2026 to confirm the files and settings it writes; the app was not built for a simulator, device or store.
Questions to ask the person#
These need no technical knowledge to answer, and each answer maps to a step below.
- iPhone, Android, or both? Each store is a separate account and build.
- Do you have an Apple Developer account and a Google Play developer account, in your name or your company's? Store publishing needs them; you can't create or pay for them.
- Who should get the app first: a few testers, or the public? Testers come first in either store: TestFlight on iPhone, a testing track on Google Play.
- What should the app be called in the stores, and what icon should it use? These go in the app's config and store listing.
- Should the phone app do everything the website does, or just the main task? This sets which screens to build.
- Which account owns the DeepSpace app? Deploying the sign-in change uses it. Confirm with your user before signing in or using a session they provide.
Step 1: Add the mobile client#
From the app's directory:
npx deepspace add mobile
It writes an Expo SDK 57 project to mobile/: App.tsx, app.config.ts, package.json, index.ts, metro.config.js, tsconfig.json, a README.md and a .gitignore. mobile/package.json pins the same deepspace version as the app, and mobile/app.config.ts reads the app id and name from wrangler.toml. Nothing in the website changes. Mobile support needs deepspace 0.39 or later; 0.39.2 or later also ends the session on the server when someone signs out.
Step 2: Allow the phone's sign-in callback, then deploy#
The phone app signs in through a custom URL scheme, the app name with the dashes removed: my-app becomes myapp. Add its callback to [vars] in wrangler.toml:
[vars]
NATIVE_AUTH_REDIRECT_URIS = "myapp://auth/callback"
Until it is listed, mobile/app.config.ts stops the build with Add NATIVE_AUTH_REDIRECT_URIS = "myapp://auth/callback" to [vars] in wrangler.toml, then deploy the Worker. The Worker accepts only exact matches; separate several callbacks with commas. Deploy so the live Worker has it:
git add -A && git commit -m "Allow the mobile sign-in callback"
npx deepspace deploy --json
Step 3: Run it in a simulator#
cd mobile
npm install
npx expo run:ios # or: npx expo run:android
Use a development build like this one, or an EAS development build. Expo Go can't receive the custom-scheme sign-in callback, so sign-in doesn't work in it.
Step 4: Build the screens#
The generated App.tsx signs in with Google and reads the app's address from mobile/app.config.ts. Its shape, with the address written out: one client created at module scope, and one DeepSpaceNativeProvider around the app:
import {
createDeepSpaceExpoClient,
DeepSpaceNativeProvider,
useDeepSpace,
} from "deepspace/native";
const deepSpace = createDeepSpaceExpoClient({
baseUrl: "https://my-app.app.space",
});
export default function App() {
return (
<DeepSpaceNativeProvider client={deepSpace}>
<Root />
</DeepSpaceNativeProvider>
);
}
function Root() {
const { isLoaded, isSignedIn, signIn } = useDeepSpace();
if (!isLoaded) return null;
if (!isSignedIn) return <SignInButton onPress={() => signIn("google")} />;
return <Home />;
}
signIn opens the provider's page in the system browser. The session is kept in the device keychain and refreshed automatically. If the person closes the sign-in sheet, signIn throws with code: 'sign_in_cancelled'; treat that as a cancellation, not an error.
Records work as on the web. Import the schemas from the app's src/ folder, so the phone and the Worker share one definition:
import {
RecordProvider,
RecordScope,
useMutations,
useQuery,
} from "deepspace/native";
import { schemas } from "../src/schemas";
function Home() {
return (
<RecordProvider>
<RecordScope roomId={`app:${APP_ID}`} schemas={schemas}>
<Items />
</RecordScope>
</RecordProvider>
);
}
Phones drop connections more often than browsers, so use createConfirmed, putConfirmed and removeConfirmed for writes that must not be lost. A write made while offline waits and is sent once the connection is back, and the server applies it at most once. Server actions are called with callAction, and integrations with integration.post, both from deepspace/native. Some web pieces aren't in the mobile entry: AuthGate, AuthOverlay, theming, useR2Files uploads, and the canvas, cron, job and collaborative-editing hooks. Show private files with useFileSource(key), which adds the person's token. See the mobile apps guide.
Step 5: Set the app's store identity#
mobile/app.config.ts has placeholders, space.app.<scheme>, for the iOS bundle identifier and the Android package. Before the first device build, replace both with identifiers registered to the person's developer accounts, for example com.examplecompany.requests.
Step 6: Build for devices and the stores#
Device and store builds use EAS Build, Expo's build service. It signs builds with the person's Apple and Google credentials, so confirm with your user before using any account, certificate or API key they provide.
iPhone (TestFlight, then the App Store):
- Make a signed build, for example with
eas build --local, which produces an.ipafile. - Upload it and wait for TestFlight:
npx deepspace testflight /path/to/app.ipa --json
This needs macOS and an App Store Connect API key. It reads the key from EXPO_ASC_API_KEY_PATH, EXPO_ASC_KEY_ID and EXPO_ASC_ISSUER_ID, the variables EAS uses, or from submit.production.ios in eas.json. It finds the app from the build's bundle id, and finishes once the build is VALID and the internal TestFlight group can install it. The JSON result has appId, bundleId, version and build.
- The person, or someone on their team, submits the build for App Store review and releases it in App Store Connect.
Android (Google Play):
- Make the Android build with EAS Build.
- Upload it in the person's Google Play Console, to a testing track first, then to production after Google's review. DeepSpace has no Google Play upload command.
Common failures and how to fix them#
| What you see | Cause | Fix |
|---|---|---|
The build stops with Add NATIVE_AUTH_REDIRECT_URIS = "…" to [vars] in wrangler.toml, then deploy the Worker. |
The sign-in callback isn't allowlisted | Add the exact line it prints, then deploy (step 2) |
| Sign-in never returns to the app in Expo Go | Expo Go can't receive the custom-scheme callback | Use npx expo run:ios, run:android or an EAS development build |
| Sign-in works locally but fails against the live app | The callback was added to wrangler.toml but the Worker wasn't deployed |
Run npx deepspace deploy |
signIn throws with code: 'sign_in_cancelled' |
The person closed the sign-in sheet | Treat it as a cancellation; check code, not instanceof |
asc_app_not_found from testflight |
No App Store Connect app has the build's bundle id | Create the app in App Store Connect with that bundle id, or fix the id in mobile/app.config.ts |
asc_no_internal_group |
No internal TestFlight group receives every build | Set one up in App Store Connect |
asc_build_invalid |
App Store Connect rejected the build | Read the reason in App Store Connect, fix and rebuild |
asc_timeout |
Processing took longer than the wait (40 minutes by default) | Run it again with a longer --timeout-minutes |
| A private image doesn't load on the phone | The phone has no session cookie for the app's address | Load it with useFileSource(key) |
| Keyboard shortcuts do nothing after an upgrade | The app binary predates the SDK's native module | Rebuild the binary |
What to tell the person#
- What they get: an iPhone and Android app that uses the same account, data and permissions as the website. Changes on one show on the other.
- What only they can do: create the Apple and Google developer accounts, pay their fees, accept their terms, and submit the app for review.
- How testing works: testers get the iPhone app through TestFlight and the Android app through a Google Play testing track, before the public release.
- How people sign in: with the same Google account they use on the website.
- What happens on updates: website changes go live with a deploy. Phone app changes need a new build and, for the public stores, a new review.
What is available today, and what is planned#
Available today, in published deepspace@0.43.0:
npx deepspace add mobile, an Expo SDK 57 client inmobile/on the same Worker, records and permissionsdeepspace/native: sign-in through the system browser with PKCE, records, user and presence hooks,callAction,integration,useFileSource- Confirmed writes that wait through dropped connections
npx deepspace testflightfor uploading signed iOS builds (macOS,deepspace0.41 or later)
Not provided by DeepSpace: Apple and Google developer accounts, store listings, store review, and Google Play uploads.
In testing on staging, not production: agent accounts that register themselves by solving a math challenge. Production signup for agents is not enabled.
Planned: autonomous agent accounts in production. Under that plan, payments and legal actions will still require a human, which includes developer account fees and store agreements. See DeepSpace for agents.
Building mobile apps for a business? See deep.space/enterprise.