Plugin Overview
Casbin’s plugin ecosystem extends the core with storage backends, framework integrations, and distributed sync. Use plugins to connect Casbin to your database, message bus, or web framework.
Plugin categories
| Category | Purpose |
|---|---|
| Enforcers | Specialized enforcers for particular environments or use cases |
| Adapters | Connect to storage (databases, files, cloud) for model and policy |
| Watchers | Sync policy changes across multiple enforcer instances |
| Dispatchers | Coordinate updates in distributed deployments |
| Role managers | Custom role/hierarchy logic |
| Middlewares | Integrations for Kong, GraphQL, and cloud-native stacks |
Why use plugins?
- Integrate with your existing DB and infra
- Scale to multiple instances with watchers and dispatchers
- Use framework-specific middlewares (e.g. Nest.js, Gin)
- Run in cloud-native and serverless setups
Getting started
- Choose the plugin type that fits your need (adapter, watcher, middleware, etc.).
- Install the package for your language.
- Configure it when creating or configuring the enforcer.
- See the plugin’s own docs for options and advanced usage.
Use the sections in this category to find and configure each plugin type.