Package Exports
- @prisma-multi-tenant/nexus
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@prisma-multi-tenant/nexus) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Nexus plugin for Prisma-multi-tenant 🧭
🧭 Add multi-tenancy to your Nexus application
Installation
npm i -g prisma-multi-tenant # CLI for tenant management
npm i @prisma-multi-tenant/nexus # Nexus plugin
prisma-multi-tenant init # Init multi-tenancy in your Nexus projectUsage
⚠️ First, make sure you followed the Prisma-multi-tenant Getting Started Guide. ⚠️
import { use } from 'nexus'
import { prismaMultiTenant } from '@prisma-multi-tenant/nexus'
const tenantRouter = (req) => {
// The name can come from anywhere (headers, token, ...)
return 'dev' // or 'my_tenant_A' or anything
}
use(prismaMultiTenant({ tenantRouter }))Since @prisma-multi-tenant/nexus is a wrapper of nexus-plugin-prisma, you can also pass along any settings accepted by nexus-plugin-prisma. (See documentation)
use(
prismaMultiTenant({
tenantRouter,
features: { crud: true },
})
)Example
Check out an example application using Nexus and the multi-tenant plugin here.
Documentation
Read more on how prisma-multi-tenant can help you achieve multi-tenancy for your apps:
- ✨ Getting Started ✨
- Complete documentation
- How to integrate with:
- Examples
- Basic (JS)
- Basic (TS)
- Express
- Apollo
- Nexus
- Blitz
- Redwood
- Bison (TODO)
- Issues with Vercel
- Contributing guide
Author
👤 Thibaud Courtoison
- Twitter: @Errorname_
- Github: @Errorname
- Prisma's Slack: @Errorname
🤝 Contributors
Contributions, issues, and feature requests are welcome! 🙌
Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2020 Thibaud Courtoison.
This project is MIT licensed.