Strapi v5 Plugin API#
Strapi v5 removed @strapi/helper-plugin entirely and redistributed its ~50 exports across @strapi/strapi/admin and @strapi/design-system . Any plugin or custom admin code that still imports from @strapi/helper-plugin will crash the admin panel at runtime — the most common symptom being TypeError: checkUserHasPermissions is not a function or useRBAC must be used within Auth .
Key Breaking Changes#
| Change | v4 | v5 |
|---|---|---|
@strapi/helper-plugin | available | removed |
useRBAC import | @strapi/helper-plugin | @strapi/strapi/admin |
useRBAC first argument | named-key object | flat array |
content-manager_rbacManager redux store | present | removed |
useRBACProvider | available | removed → use useAuth |
hasPermissions util | available | removed → use checkUserHasPermissions via useAuth |
CheckPagePermissions | redirects on no perms | Page.Protect renders NoPermissions instead |
useCMEditViewDataManager | available | unstable_useContentManagerContext in @strapi/strapi/admin |
Additional breaking changes affecting plugins: injectContentManagerComponent() removed, EditViewLayout/ListViewLayout refactored, and Design System upgraded .
useRBAC Signature Change#
The first argument changed from a named-key object to a flat array :
// v4
const { allowedActions } = useRBAC({ main: [{ action: 'admin::something.main', subject: null }] });
// v5
const { allowedActions } = useRBAC([{ action: 'admin::something.main', subject: null }]);
allowedActions keys in v5 are derived from the last dot-separated action segment, CamelCased (e.g. admin::roles.create-draft → canCreateDraft) . Passing an object still works but logs a deprecation warning .
Internally, useRBAC pulls checkUserHasPermissions from the Auth context via useAuth. If a plugin renders outside the v5 <AuthProvider> tree, checkUserHasPermissions is undefined and the crash occurs .
Common Crash Patterns#
| Error | Affected view | Root cause |
|---|---|---|
checkUserHasPermissions is not a function | Media Library, Content Manager | Plugin importing from @strapi/helper-plugin or using v4 useRBAC syntax |
useRBAC must be used within Auth | Media Library (/admin/plugins/upload) | useRBAC() called before <AuthProvider> mounts |
Cannot read properties of undefined (reading 'tours') | Content-Type Builder | GuidedTour context not yet initialized; related to old plugin reading stale redux store shape |
| Infinite loading spinner | Content Manager | Permissions never resolve due to unmigrated RBAC logic |
The checkUserHasPermissions crash was also reproduced as a version-specific regression in Strapi v5.31.3 and resolved by upgrading to v5.34.0 .
Migration#
Run the codemod first — the deprecate-helper-plugin codemod handles a subset of import relocations automatically :
npx @strapi/upgrade@latest 5.0.0
Then address remaining manual changes using the full helper-plugin migration reference . The most common patterns:
useRBAC: move import to@strapi/strapi/admin, change argument to arrayuseRBACProvider: replace withuseAuthfrom@strapi/strapi/adminhasPermissions: replace withcheckUserHasPermissionsviauseAuthselectorCheckPagePermissions: replace withPage.Protectfrom@strapi/strapi/adminuseCMEditViewDataManager: replace withunstable_useContentManagerContextuseNotification: move import;warningtype becomesdanger; return type is now an object
After updating, clean and rebuild:
rm -rf .cache build dist node_modules && npm install && npm run build
Diagnosing third-party plugins: search for unmigrated dependencies:
grep -r "helper-plugin" ./node_modules --include="package.json" -l
grep -r "from '@strapi/helper-plugin'" ./src -l
Key References#
| Resource | Link |
|---|---|
helper-plugin breaking change doc | docs.strapi.io |
| Full helper-plugin migration reference | docs.strapi.io |
| RBAC store breaking change doc | docs.strapi.io |
useRBAC hook source | packages/core/admin/admin/src/hooks/useRBAC.ts |
Auth.tsx (checkUserHasPermissions) | packages/core/admin/admin/src/features/Auth.tsx |
deprecate-helper-plugin codemod | packages/utils/upgrade/resources/codemods/5.0.0/ |
| All v5 plugin-affecting breaking changes | docs.strapi.io |