Getting started
This section guides you through creating a new TwoTaps-powered site from scratch. The fastest path is the bootstrap:site CLI command — it clones a ready-to-use Next.js boilerplate, wires in your environment variables, generates TypeScript types for your schemas, and scaffolds all your block components automatically.
⚡
A complete sandbox site, fully connected to your TwoTaps organisation, takes under 5 minutes to set up.
What you’ll need
- Node.js 22 or later
- Git installed and available in your
PATH - Yarn (the boilerplate uses Yarn as its package manager)
- A TwoTaps API token — generate one from your organisation’s administration panel
What the bootstrapper does
The bootstrap:site command automates every manual step involved in setting up a new TwoTaps site:
| Step | What happens |
|---|---|
| 1 | Clones the official Next.js boilerplate into your target directory |
| 2 | Setting up.env and fills in your GraphQL URL, public host, and base path |
| 3 | Runs yarn to install all dependencies |
| 4 | Calls the schema-builder endpoint to generate types.ts with TypeScript interfaces for every schema in your schema set |
| 5 | Fetches your block schema names and scaffolds a stub React component for each one in src/components/ |
| 6 | Configures components in NEXT_COMPONENTS wiring map — ready to drop into a block renderer |
Last updated on