Skip to content
Ink
Esc
↑↓navigate↵open⌘Jpreview
On this page

Project structure

App files, folders and generated output.

my-app/
  app/
    index.tsx
  ink.toml
  package.json
  tsconfig.json
  README.md
File or folder What it does
app/index.tsx Your home screen
app/ Pages; each page exports a React component
ink.toml App name, Android identifier, version and release signing
package.json Packages your app uses and where to find local Ink packages
tsconfig.json TypeScript settings; keep its ink/tsconfig extension
bun.lock Exact installed package versions; keep it in version control
node_modules/ Installed packages; generated by Bun
.ink/ Generated entry point and build files; do not edit
dist/ Built APKs, the files you install on a phone

Use optional components/, lib/ and assets/ folders for reusable components, data helpers and images. Keep non-page files outside app/.

Ink generates the app entry point. Add app/_layout.tsx when pages need shared state or tabs; see layouts.

Environment variables

Prefix environment variables with INK_PUBLIC_ to include them in the app:

# .env
INK_PUBLIC_BRIDGE_URL=https://bridge.example.com
const bridgeURL = import.meta.env.INK_PUBLIC_BRIDGE_URL;

Ink reads .env, then .env.local. Shell variables take precedence. Values are strings; a missing variable is undefined. Rebuild the app to change them, or edit the file while ink dev is running.

Values are readable from the APK. Use Secure storage for passwords and encryption keys. Add .env.local to .gitignore.

Native features and app policies

Imports determine native modules automatically. Import @ink/lightos to include LightOS services; the old [lightos] enabled setting is no longer accepted. An optional [lightos] server changes the Android host application ID.

Use [network] allow_cleartext = true only when your app needs unencrypted HTTP. See Network. Configure background entry points and authentication redirects on their module pages.

The top-level capabilities array remains an advanced override for app-local native extensions. Ordinary apps do not need to repeat imported features there. Existing network-cleartext entries can be replaced with the network policy above.