Skip to main content
Version: 1.x

Built-in Plugins

ZenStack ships with a set of built-in plugins. They fall into the following two categories.

Core Plugins

Most of the core functionalities of ZenStack are implemented as or supported by a few core plugins. They're vital to the operation of ZenStack and are enabled automatically as needed. Core plugins are implemented inside the zenstack npm package and have names starting with @core/.

Here's a quick overview of them:

  • @core/prisma

    Transforms ZModel to Prisma schema and runs prisma generate to generate Prisma Client.

  • @core/model-meta

    Transforms ZModel to lightweight Javascript to be used at runtime.

  • @core/access-policy

    Transforms access policies into partial Prisma query objects for injecting Prisma queries at runtime.

  • @core/zod

    Transforms ZModel into Zod schemas for validating input data at runtime.

The ZenStack CLI automatically decides whether a core plugin should be enabled based on the ZModel. You can also explicitly declare a core plugin to override its options. For example, declare a @core/prisma plugin to output the generated Prisma schema file to a custom location:

plugin prisma {
provider = "@core/prisma"
output = "src/db/prisma/schema.prisma"
}

Maintained Plugins

Besides core plugins, the ZenStack team maintains a set of useful but non-essential plugins. They are implemented in separate npm packages under the @zenstackhq organization.

Comments
Feel free to ask questions, give feedback, or report issues.

Don't Spam


You can edit/delete your comments by going directly to the discussion, clicking on the 'comments' link below