Skip to main content

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

CategoryPurpose
EnforcersSpecialized enforcers for particular environments or use cases
AdaptersConnect to storage (databases, files, cloud) for model and policy
WatchersSync policy changes across multiple enforcer instances
DispatchersCoordinate updates in distributed deployments
Role managersCustom role/hierarchy logic
MiddlewaresIntegrations 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

  1. Choose the plugin type that fits your need (adapter, watcher, middleware, etc.).
  2. Install the package for your language.
  3. Configure it when creating or configuring the enforcer.
  4. See the plugin’s own docs for options and advanced usage.

Use the sections in this category to find and configure each plugin type.