
Create and manage interactive H5P content directly in Strapi CMS. Supports 40+ content types including quizzes, videos, and presentations.
released February 21, 2026
npm install strapi-plugin-h5pCreate and manage interactive H5P content directly in your Strapi CMS.
npm install strapi-plugin-h5p
# or
yarn add strapi-plugin-h5pCreate or update config/plugins.ts:
export default () => ({
h5p: {
enabled: true,
config: {
// H5P library storage path (relative to public folder)
librariesPath: "h5p/libraries",
// H5P content storage path (relative to public folder)
contentPath: "h5p/content",
// H5P temporary files path (relative to public folder)
temporaryFilesPath: "h5p/temp-files",
},
},
});Update config/middlewares.ts to include the H5P middleware and CSP settings:
export default [
"strapi::logger",
"strapi::errors",
{
name: "strapi::security",
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
"script-src": ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
"style-src": ["'self'", "'unsafe-inline'"],
"frame-src": ["'self'"],
"img-src": ["'self'", "data:", "blob:", "https://h5p.org", "https://*.h5p.org"],
"connect-src": ["'self'", "https://h5p.org", "https://*.h5p.org"],
},
},
},
},
"strapi::cors",
"strapi::poweredBy",
"strapi::query",
"strapi::body",
"strapi::session",
"strapi::favicon",
"strapi::public",
"plugin::h5p.h5p",
];The plugin requires H5P core and editor files to be present. Run the setup script:
# Using npx (recommended)
npx strapi-plugin-h5p setup
# Or using npm script
npm run setup --prefix node_modules/strapi-plugin-h5p
# Or manually run the script
node node_modules/strapi-plugin-h5p/scripts/setup-h5p.jsThis will download and extract H5P core and editor files to public/h5p/libraries/.
npm run build
npm run developThe plugin provides the following API endpoints:
| Endpoint | Method | Description |
|---|---|---|
/api/h5p/libraries | GET | List installed H5P libraries |
/api/h5p/contents | GET | List all H5P content |
/api/h5p/contents/:id | GET | Get specific H5P content |
/api/h5p/play/:contentId | GET | Render H5P player HTML |
/api/h5p/ajax | GET/POST | H5P AJAX endpoint for editor |
To display H5P content in your frontend, you can use the h5p-standalone library:
import { H5P } from "h5p-standalone";
const el = document.getElementById("h5p-container");
const h5pContent = await fetch("/api/h5p-contents/1").then(r => r.json());
new H5P(el, {
h5pJsonPath: `/api/h5p/content/${h5pContent.data.h5pContent.contentId}`,
frameJs: "/h5p/core/js/h5p.js",
frameCss: "/h5p/core/styles/h5p.css",
});The plugin supports all standard H5P content types, including:
This warning appears when Strapi cannot connect to h5p.org to check for updates. Your existing content types will still work. To update, ensure your server can reach h5p.org.
config/middlewares.tspublic/h5p/libraries/If you see errors like:
File not found: public/h5p/libraries/editor/scripts/h5peditor-pre-save.js
File not found: public/h5p/libraries/editor/ckeditor/ckeditor.jsThis means the H5P core and editor files are missing. Run the setup script:
npx strapi-plugin-h5p setupMIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
