Build an app for the phone.
3DX Phone apps are small web apps: HTML, CSS and JavaScript in their own sandboxed window, with an SDK for storage, notifications and Sign in with DX-ID. The kit has everything to build one and send it to the App Store.
Your first app in three commands
Unzip the kit, open a terminal in its folder and run:
node 3dx-app.mjs init my-app --id my-app --name "My App"
node 3dx-app.mjs serve --app my-app
node 3dx-app.mjs pack my-appinit writes a starter app. serve prints a link to the phone preview with your app inside: edit my-app/app.js, press Reload, repeat. pack checks the app the way the App Store will and writes a package to dist-apps/.
What's in the kit
3dx-app.mjs- The command-line tool: start an app, preview it, pack it, sign in with your DX-ID, apply, submit and follow your reviews.
app-sdk.js- The SDK for apps without a build step. It sets window.Phone3DX.
sdk/- The same SDK as an ES module with types, plus server.js to verify Sign in with DX-ID tokens on your own server.
dev-shell.html- The phone preview. It plays the phone's side of the bridge, so your app runs there as it will on the phone.
examples/hello-3dx/- A small working app: a list kept with phone.storage and a notification when you add to it.
README.md- Everything on this page and the publishing steps, offline.
What an app can do
const { phone } = window.Phone3DX;
async function addPlan(text) {
const plans = (await phone.storage.get("plans")) ?? [];
await phone.storage.set("plans", [...plans, { text }]);
await phone.notifications.post({ title: "Plan added", body: text });
}
addPlan("Pool party");
phone.app.ready(); // once your first screen is paintedApps keep their data with phone.storage, post notifications, give tap feedback, and can let players sign in with their DX-ID instead of a new password. Network access is limited to the hosts an app declares, and the player sees every permission before installing. The reference lists every call.
From the kit to the App Store
Apply for a developer account with your DX-ID, submit with node 3dx-app.mjs submit, and a person tests every app before it goes live. Publishing walks through each step.
