astro-strapi-loader

Load Strapi data into Astro content collections at build time.

17|3|Updated May 30, 2025
One-click install
npx skills add https://github.com/VirtusLab-Open-Source/astro-strapi-loader --skill astro-strapi-loader
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: astro-strapi-loader
Source: https://github.com/VirtusLab-Open-Source/astro-strapi-loader/tree/main/.ai/astro-strapi-loader
Command: npx skills add https://github.com/VirtusLab-Open-Source/astro-strapi-loader --skill astro-strapi-loader

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use @sensinum/astro-strapi-loader with Astro Content Layer: build Strapi REST query objects (object and object-array populate per REST parameters), let qs.stringify serialize—never inline query strings. Composable query fragments, dynamic zone "on", locale strategies, generateCollections, getCollection / getEntry. Strapi 5, Astro 6+.

Core Features & Use Cases

  • Load Strapi data at build time into Astro content collections with correct populate graphs, dynamic zones, and i18n.
  • Build REST query objects using Strapi parameters (populate, locale, filters, sorts) and serialize them with qs.stringify for safe URLs.
  • Support per-locale collections and multiple collections from the same endpoint, with composeable fragments and dynamic zones.

Quick Start

Configure generateCollections in src/content.config.ts and run the build to populate Astro collections from Strapi.

Frequently Asked Questions about astro-strapi-loader

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load Strapi data into Astro content collections at build time?▼

To load Strapi data into Astro at build time, configure generateCollections in src/content.config.ts and run the build to populate Astro content collections directly from your Strapi 5 endpoints.

How do I build Strapi REST queries with populate and locale parameters in Astro?▼

Build Strapi REST query objects using populate, locale, filters, and sorts parameters, then serialize them with qs.stringify. Never inline query strings manually; use composable fragments for safe URL construction.

Does this Astro Strapi loader support dynamic zones and i18n per-locale collections?▼

Yes, the loader supports dynamic zone "on" parameters and i18n locale strategies. It enables per-locale collections and can generate multiple collections from the same Strapi endpoint.

What versions of Strapi and Astro are required for build-time content loading?▼

Build-time content loading requires Strapi 5 and Astro 6 or higher. You need these versions to properly utilize the Astro Content Layer and generateCollections for REST query objects.

Why should I use qs.stringify instead of inline query strings for Strapi REST queries?▼

Using qs.stringify to serialize Strapi REST query objects ensures safe URL construction. Manually inlining query strings is discouraged because it bypasses proper populate, locale, and filter parameter serialization.