Installing blocks
What’s inside a block
A block can contain any combination of:
For example, the
reviews block includes a module (data model + service), workflows (create/update/delete), API routes (store, vendor, admin), links (product-review, seller-review), and UI pages for both the vendor portal and admin panel.
Block structure
Blocks follow a consistent directory convention:blocks.json:
blocks.json
Post-installation
After adding a block, the CLI shows setup instructions. Typically you need to:- Register the module in
medusa-config.ts - Add middlewares to your
api/middlewares.ts - Run migrations with
bunx medusa db:generateandbunx medusa db:migrate - Regenerate types with
bunx @mercurjs/cli@latest codegen