Strapi ORM v1.2.7 is a TypeScript library that simplifies interacting with Strapi CMS by providing decorators to map API responses to classes and generating query parameters. It supports field mapping for components, relations, and custom mappers, as well as automatic relation population and entity fetching. The library is actively maintained but still early-stage (v1.x). Key differentiators include decorator-based mapping, built-in relation extraction, and an Entity class with fetch method. Alternative libraries like @strapi/strapi or custom fetch wrappers exist, but Strapi ORM offers a structured ORM-like approach.
npm install strapi-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates class definition with decorators, relation extraction, entity fetching, and query building using Strapi ORM.
Use the documented deep import paths, but be aware they are internal and may break. Consider contributing to the library to officially export them.
Ensure that the property name in your class matches the attribute name in Strapi's response (case-sensitive).
Always pass full URL like `${strapiURL}/api/home`.Pin dependency to exact version and test after upgrades.
Check that you have the correct path. In v1.2.7, use 'strapi-orm/lib/util/relationUtil' exactly. Alternatively, open an issue to request official export.
Ensure 'import { StrapiObject } from 'strapi-orm'' is placed before any class that extends it.Change 'extends StrapiObject' to 'extends Entity' in your class definition.
Use optional chaining (?. ) when accessing nested relation properties, or ensure your Strapi API returns the expected data.
No dependency data recorded yet.