# Starter kits & SDK demos

> Create a Lia app with guided terminal setup, browser-approved login and automatic private app registration. Choose from nine framework integrations. From the Lia developer docs: https://docs.lialabs.org/packages/starters

## Create a project

```sh
npm create @lia-labs/app@latest
```

Lia Developer Studio guides you through your project, framework, starter, setup and account. Use the arrow keys to choose your framework and **Starter** or **SDK playground**. **Recommended** settings enable local browser simulation and install dependencies with the package manager you are using. **Customize** lets you change the public app ID, package manager, local simulation and installation preference. Setup validates your directory before creating files, shows installation progress and prints recovery commands if an install fails. Press Ctrl+C to cancel. Existing nonempty folders are never overwritten.

Use a supported Node LTS version: Node 22.12+ or 24+ is recommended. The starters select framework versions compatible with the current Lia bindings, including Preact 10 and Solid 1.

```sh
cd my-lia-app
npm install
npm run dev
```

Skip `npm install` if setup already installed dependencies. Use matching commands for your selected package manager.

## Connect your Lia account

After creating your files, choose **Connect & register** to open Lia Developers in your browser. Sign in with your Lia account, compare the code shown in the terminal, and approve the request. Your app is created as a private test listing in your developer dashboard. Choose **Keep building locally**, or pass `--local`, to register later.

```sh
npx @lia-labs/create-app@latest login
npx @lia-labs/create-app@latest whoami
npx @lia-labs/create-app@latest apps
```

Already have a generated project? Register it from the project directory:

```sh
npx @lia-labs/create-app@latest register --name "My game" --kind game
```

You can also create and register in one command:

```sh
npm create @lia-labs/app@latest my-game -- --framework react --template demo --register --kind game
```

Registration does not require hosting yet. Until you add a deployed HTTPS URL in the dashboard, opening the listing shows a setup placeholder. Use `--url https://your-app.example` when registering if hosting is ready. Registering an app ID you already own links the project to that listing without editing it; an ID owned by someone else is rejected. Manage URL changes, artwork, testers and review in the dashboard.

The public app ID is saved in `lia.config.json` and the generated framework configuration. Registration adds dashboard and hostname information to that file. Account credentials are stored separately on your computer; they are never written into the project or generated browser code.

A browser approval code expires after ten minutes. Terminal access lasts up to thirty days and can list your apps, create private test listings and connect local previews to your private test apps. It cannot publish apps, read server keys or make payouts. Use **Connected terminals** on the dashboard to revoke a terminal immediately, or sign out from the command line:

```sh
npx @lia-labs/create-app@latest logout
```

Only approve a code you started yourself. Existing developer access requirements still apply; terminal login does not bypass the invitation process. If a browser cannot open automatically, use `login --no-browser` and open the printed link yourself. Declined or expired requests can be retried with `login`.

## Preview your local app inside Lia

From your registered project, run:

```sh
npx @lia-labs/create-app@latest dev
```

The CLI starts your framework’s development server, opens a temporary Cloudflare Tunnel and connects it to your private test listing. Open the app again in Lia under **Apps → Testing**. Subsequent edits use your framework’s live reload, so you can keep testing on your phone while changing local files. No Cloudflare account or DNS configuration is needed.

If Cloudflare Tunnel is not installed, Lia downloads the official helper into your user cache and checks its release checksum before running it. It does not install a background service. Choose another port with `--port 4201`, or a package manager with `--pm pnpm`.

The live panel shows your local server, HTTPS tunnel and connected Lia app. Press **o** to open the app link, **d** for its dashboard, or **q** / Ctrl+C to stop. Existing terminal grants need one new browser approval for local preview access.

Your permanent Page URL is unchanged. Stopping removes the preview connection, and a lost terminal expires its connection within two minutes. Local previews work only with private test apps and cannot replace a live app. Deploy permanent HTTPS hosting before submitting for review.

The temporary tunnel URL is public to anyone who has it, while the Lia listing remains restricted to your existing testers. Keep production secrets and private customer data out of local browser previews. Quick Tunnels are development infrastructure with no uptime guarantee.

## Terminal preferences

The interface adapts to smaller terminals. Set `NO_COLOR=1` for plain colors, `LIA_NO_MOTION=1` to reduce progress animation, or `ACCESSIBLE=1` for standard text prompts. CI and redirected output stay static. The CLI reports real setup steps rather than a simulated percentage.

## Choose a framework

| Framework | Command | Lia integration |
| --- | --- | --- |
| Plain TypeScript | `npm create @lia-labs/app@latest my-app -- --framework vanilla` | Typed SDK calls and observable state. |
| React | `npm create @lia-labs/app@latest my-app -- --framework react` | `useInit`, `usePlayer`, `useLanguage`, `useMainButton`. |
| Preact | `npm create @lia-labs/app@latest my-app -- --framework preact` | Preact hooks and the Lia Preact bindings. |
| Vue | `npm create @lia-labs/app@latest my-app -- --framework vue` | Composables, refs and component cleanup. |
| Svelte | `npm create @lia-labs/app@latest my-app -- --framework svelte` | Svelte stores and component-scoped controls. |
| Solid | `npm create @lia-labs/app@latest my-app -- --framework solid` | Accessors, `createInit` and `createMainButton`. |
| Angular | `npm create @lia-labs/app@latest my-app -- --framework angular` | A standalone Angular app with injected signals. |
| Web components | `npm create @lia-labs/app@latest my-app -- --framework elements` | `<lia-app>`, `<lia-main-button>` and the typed SDK. |
| Low-level bridge | `npm create @lia-labs/app@latest my-app -- --framework bridge` | Advanced typed `request`, `send` and event examples. |

Angular uses its application builder. Other starters use Vite. All starters use TypeScript; framework-specific component files are included so you can adapt the integration directly.

## Start with a working SDK demo

Add `--template demo` for an interactive feature catalogue in your framework:

```sh
npm create @lia-labs/app@latest my-react-demo -- --framework react --template demo
npm create @lia-labs/app@latest my-vue-demo -- --framework vue --template demo
npm create @lia-labs/app@latest my-angular-demo -- --framework angular --template demo
```

Framework demos include dialogs, haptics, identity, session refresh, test purchases, rewarded/interstitial/banner/native ads, sharing, storage, media capture, biometrics, QR scanning, screen controls, reminders and scores. Each action has code, loading feedback and a response readout. Unsupported features and permission cancellations are handled without crashing. Session tokens and file contents are omitted from the readout.

The advanced bridge demo focuses on raw typed messages. Framework demos use their respective bindings for reactive player identity, language and native controls; they share typed feature examples, not an iframe wrapping the plain JavaScript demo.

You can also open the hosted **SDK demo** inside Lia under **Apps → Testing**. Every registered developer has access without a separate tester grant. The portal’s welcome tour and dashboard link to it.

## Browser simulation and real testing

Local development installs `mockLia()` only outside Lia. Payments, ads and rewards are simulated; no real session or payout is created. Production builds omit the development mock. Angular replaces its development module; Vite starters use the build’s development flag.

Disable simulation with `--no-mock`. For Vite projects, you can also set `VITE_LIA_MOCK=false` in a local development environment file. Native permissions and hardware still need testing inside Lia.

1. Run `npm run build` and host the output over HTTPS (`dist/`, or `dist/browser/` for Angular).
2. Register through the CLI or create the app in the [developer portal](https://developers.lialabs.org). Set its deployed HTTPS URL before testing. An app ID in code alone does not register a listing or authenticate requests.
3. You and up to five additional testers find it under **Apps → Testing**, regardless of its publishing category.
4. For the purchase example, create an active `demo-coins` test product in the portal.
5. Put a test app away with **Settings → Archive app**. It disappears from everyone’s native Apps list and can be restored without deleting configuration or test data.

Public release requires review. Open developer access is planned for Q1 2027; the CLI does not bypass current invitation or publication requirements.

## Keep valuable decisions on your server

Never trust client callbacks, scores, local storage values or ad close events to grant currency, items or rewards. Keep server keys and webhook secrets out of browser code and all `VITE_*` variables.

The starter does not fake server verification or include an insecure delivery endpoint. Demo purchases and score submissions are restricted to test mode. Add a backend that [verifies sessions](/guides/verify-on-your-server), checks each charge’s app, player, product, mode and status, delivers once and acknowledges delivery. Keep test and live accounting separate.

## Package managers and automation

```sh
pnpm create @lia-labs/app my-app --framework vue --template demo
yarn create @lia-labs/app my-app --framework svelte
bun create @lia-labs/app my-app --framework solid
```

For scripts or CI:

```sh
npm create @lia-labs/app@latest my-app -- --framework react --template starter --app-id my-app --yes --no-install --local
```

Noninteractive setup stays local unless you pass `--register`; registering without prompts requires an existing terminal login. Use `--install` to install automatically. `--help` lists options. If installation fails, generated files remain available and the CLI prints the command to retry.

## Add a secure backend

Run `npx @lia-labs/create-app@latest backend` for a separate server project in TypeScript/JavaScript, Python, PHP or Go. Choose Node/Express, FastAPI/Django, PHP HTTP or Go HTTP. These starters include verified player sessions, signed webhooks, paid-charge checks and persistent inventories with unique receipts. Keep server secrets out of your frontend. See [backend packages and framework integration guides](/packages/server).
