Introduction to Strapi2Front
Strapi2Front is a powerful CLI tool that automatically generates type-safe TypeScript code from your Strapi CMS schema. Stop writing boilerplate code and let Strapi2Front handle types, services, validation schemas, and server actions for you.What is Strapi2Front?
Strapi2Front bridges the gap between your Strapi backend and frontend applications by:- Auto-generating TypeScript types from your Strapi content types
- Creating type-safe service functions for data fetching
- Building Zod validation schemas for forms and data validation
- Generating framework-specific actions (Astro, Next.js, Nuxt, and more)
- Supporting both Strapi v4 and v5 with intelligent version detection
- Working with JavaScript projects via JSDoc annotations (no TypeScript required)
Type Safety
End-to-end type safety from your CMS to your frontend components
Zero Boilerplate
Generate thousands of lines of code with a single command
Framework Agnostic
Works with Astro, Next.js, Nuxt, SvelteKit, and any TypeScript/JavaScript project
Always in Sync
Keep your frontend types synchronized with your Strapi schema
Key Features
TypeScript & JSDoc Support
Strapi2Front works with both TypeScript and JavaScript projects:- TypeScript
- JavaScript (JSDoc)
Generated Code Structure
Strapi2Front uses a by-feature structure (screaming architecture) that organizes code by content type:Form Validation with Zod
Generate ready-to-use Zod schemas for form validation:Framework-Specific Actions
Generate type-safe server actions for your framework:- Astro
- Next.js
- Nuxt
File Upload Support
Built-in file upload helpers for browser and server:Supported Strapi Versions
Strapi v5
Full support with automatic version detection and Document Service API
Strapi v4
Complete compatibility with Entity Service API and legacy schemas
Requirements
1
Node.js 18+
Strapi2Front requires Node.js version 18 or higher
2
Strapi v4 or v5
Works with both Strapi v4 and v5 backends
3
Package Manager
Compatible with npm, pnpm, yarn, and bun
How It Works
1
Configure Connection
Run
npx strapi2front init to set up your Strapi connection and preferences2
Sync Schema
Run
npx strapi2front sync to fetch your Strapi schema and generate code3
Use Generated Code
Import types, services, and actions in your frontend application
4
Stay Synchronized
Re-run sync whenever your Strapi schema changes
Framework Support
Types, Services, and Schemas work with any TypeScript or JavaScript framework. Framework-specific Actions are being added progressively.
Next Steps
Quick Start
Get up and running in 2 minutes
Installation
Detailed installation and setup guide
Configuration
Configure Strapi2Front for your project
CLI Reference
Complete command-line interface documentation
Community & Support
Strapi2Front is open source and built with ❤️ by Eleven Estudio.GitHub
View source code and contribute
Report Issues
Found a bug? Let us know