Search Documentation
Search guides, functions, classes, interfaces, and more
Add a miniapp to a Turbo monorepo
Add a MobyApps miniapp under apps/ in an existing pnpm + Turbo workspace.
Prerequisites
- Root
.npmrc:@mobyapps:registry=https://npm.mobyapps.dev/ - Install @mobyapps packages pattern at workspace root
Option A — Scaffold into monorepo (recommended)
From the repo root:
pnpm create @mobyapps/miniapp@latest apps/my-miniapp pnpm install
App-kit is already included in the scaffold — no shadcn add @mobyapps/app-kit step.
Option B — Manual add to existing app
- Add dependencies in
apps/my-miniapp/package.json:
{ "dependencies": { "@mobyapps/bridge": "^1.0.8", "@mobyapps/sdk": "^1.0.8", "@mobyapps/build-utils": "^1.1.2" }, "scripts": { "dev": "next dev --turbopack -p 3010", "build": "next build", "miniapp": "next build && build-miniapp", "publish": "next build && build-miniapp --publish" } }
- Configure shadcn and install app-kit:
cd apps/my-miniapp npx shadcn@latest init npx shadcn@latest add @mobyapps/app-kit
- Copy layout, i18n, theme providers, and CSS layers from the create-miniapp scaffold.
Turbo configuration
Ensure pnpm-workspace.yaml includes apps/*.
Add custom tasks if needed:
{ "tasks": { "build": { "dependsOn": ["^build"], "outputs": [".next/**", "out/**", "dist/**"] }, "miniapp": { "dependsOn": ["build"], "outputs": ["dist/**"] }, "dev": { "cache": false, "persistent": true } } }
Run from repo root
pnpm --filter my-miniapp dev pnpm --filter my-miniapp miniapp pnpm --filter my-miniapp publish
Portal vs miniapp styling
Each app owns its theme via local CSS overrides — see Miniapp theming. A web portal and a miniapp in the same monorepo can use different brands without sharing PostCSS config.