Permix is a lightweight, framework-agnostic, type-safe permissions management library for JavaScript applications on the client and server sides.
@aminzoubaa/permix is a maintained public fork of the original permix package, which was created by Valerii Strilets.
This fork exists so the improved Next.js integration, multi-role composition, hydration fixes, examples, and test coverage can be used immediately in production projects without waiting for the upstream release cycle.
If you are looking for the original project, see:
- npm:
permix - GitHub: letstri/permix
You can find the documentation here.
If you are using Next.js App Router, start with the dedicated Next.js guide and the official reference apps:
To quick start you only need to write the following code:
import { createPermix } from '@aminzoubaa/permix'
const permix = createPermix<{
post: {
action: 'read'
}
}>()
permix.setup({
post: {
read: true,
}
})
permix.check('post', 'read') // truePermix has other powerful features, so check out the docs and the guided examples.
Permix 4.x is a major release line that improves SSR hydration and request-scoped Next.js usage. If you are upgrading from 3.x, read the migration guide before updating.
MIT License - see the LICENSE file for details