Skip to main content
This guide will get you from zero to generating types and services from your Strapi CMS in minutes.

Prerequisites

Before you begin, make sure you have:
  • Node.js 18+ installed on your machine
  • A Strapi v4 or v5 instance running (local or remote)
  • An API token from your Strapi admin panel

Installation

1

Install Strapi2Front

Install the CLI as a dev dependency in your project:
2

Initialize Configuration

Run the init command to create a configuration file:
This creates a strapi.config.ts file in your project root with sensible defaults.
3

Configure Your Connection

Update the generated config file with your Strapi URL and token:
strapi.config.ts
Store your API token in a .env file and never commit it to version control:
.env
4

Generate Code

Run the sync command to fetch your Strapi schema and generate code:
You should see output like:

Using Generated Code

Once generation completes, you can import and use the generated types and services:

Add to Your Workflow

Add a script to your package.json to regenerate code when your Strapi schema changes:
package.json

Next Steps

Configuration

Explore all configuration options

Services Guide

Learn about generated service methods

Framework Setup

Set up your framework integration

API Reference

View the complete CLI reference