@habeetat/create-app
v0.3.16
Published
Scaffold a local app wired to a Habeetat platform (npm create @habeetat/app)
Readme
@habeetat/create-app
Scaffold a local app already wired to a Habeetat platform — no client ids, endpoints or resource indicators to copy by hand.
npm create @habeetat/app my-appThe command signs you in, asks which organization and which installed app you are building,
and writes a working pnpm workspace whose .env files are filled in from what the platform
actually reports.
What it does
- Discovers the platform. Reads the platform's public runtime config (Logto endpoint, API base, API resource) — nothing is hardcoded in the generated project.
- Signs you in. Browser-based OIDC with PKCE on a loopback callback. No client secret is involved and no credential is stored in the scaffolded project.
- Asks which organization. Only the ones you are a member of; the server does the filtering.
- Asks which app. Only scaffold-ready installed apps — those that already have an M2M credential and a Logto client. Apps that are installed but not ready are reported, with the reason, rather than silently hidden.
- Generates the project, pinning
@habeetat/sdk-node/@habeetat/sdk-reactto the version currently published on npm.
Generated layout
my-app/
package.json # pnpm workspace: dev, build, update:habeetat
pnpm-workspace.yaml
apps/backend/ # NestJS + @habeetat/sdk-node, .env pre-filled
apps/frontend/ # Vite + React + @habeetat/sdk-react, .env pre-filledEverything the app needs to talk to the platform is already in the two .env files, with one
deliberate exception (see below). A matching .env.example is written next to each.
The one thing it cannot fill in
HABEETAT_M2M_CLIENT_SECRET in apps/backend/.env is left as a placeholder. The M2M secret is
shown once, to the org manager, at the moment the app is installed — the platform does not
store it in a readable form and no API can hand it back. Ask your org manager for it and paste it
in before pnpm dev; if it has been lost, it can be rotated from the Platform Manager.
Options
Usage: create-app [dir] [options]
Arguments:
dir target directory (prompted if omitted)
Options:
--platform <url> platform base URL (env: HABEETAT_PLATFORM_URL)
--cli-client-id <id> "Habeetat CLI" OIDC client (env: HABEETAT_CLI_CLIENT_ID)
--webhooks also scaffold an inbound webhook receiver
-h, --help display helpPoint --platform at your own installation to scaffold against it:
npm create @habeetat/app my-app -- --platform https://api.acme.example.comRequirements
- Node.js >= 18
- Membership of an organization on the target platform, with the app already installed by an org manager
Related
create-habeetat— install a whole platform@habeetat/sdk-node— backend SDK@habeetat/sdk-react— frontend SDK
License
MIT
