Skip to content

AminZoubaa/permix

Repository files navigation

Permix

npm version bundle size license release docs

Permix is a lightweight, framework-agnostic, type-safe permissions management library for JavaScript applications on the client and server sides.

Fork Notice

@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:

Documentation

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:

Example

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') // true

Permix has other powerful features, so check out the docs and the guided examples.

Migration

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.

License

MIT License - see the LICENSE file for details

About

Maintained fork of Permix with production-focused Next.js improvements

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages