Skip to content

Introduction

Strapi2Front is a CLI tool that generates TypeScript types, API services, Zod schemas, and framework-specific code from your Strapi schema.

Type-Safe API

Auto-generate TypeScript types matching your Strapi content types, including relations, components, and media.

API Services

Generate ready-to-use service functions with full CRUD operations, filtering, pagination, and population.

Zod Schemas

Create validation schemas for forms with React Hook Form, TanStack Form, and more.

Framework Integrations

First-class support for Astro Actions, with Next.js and Nuxt support coming soon.

After running npx strapi2front sync, you get:

// Auto-generated types
interface Article {
id: number;
documentId: string;
title: string;
content: string;
author: Author;
publishedAt: string | null;
}
// Ready-to-use service
import { articleService } from '@/strapi/collections/article';
const articles = await articleService.find({
filters: { title: { $contains: 'TypeScript' } },
populate: ['author'],
});
// Zod schema for forms
import { articleCreateSchema } from '@/strapi/collections/article/schemas';
const form = useForm({
resolver: zodResolver(articleCreateSchema),
});
  • Zero Configuration: Works out of the box with sensible defaults
  • Strapi v4 & v5: Full support for both versions with automatic detection
  • By-Feature Architecture: Organize generated code by content type for better scalability
  • i18n Support: Built-in localization support for multilingual content
  • Draft & Publish: Full support for Strapi’s draft and publish workflow