I would like to use Supertokens as apart of my platform where I can offer auth for my customers that they can use for their memberships / courses. As well as use it for the platform it self.
The issue is multi-tenancy. One user could be a part of multiple organizations. Also, each organization would have their own users.
It looks like on the road map this is coming... Wanted to get feedback on the solutions:
A.) Easiest, but seems hacky is Supertokens doesn't verify email format with the rest api, it seems, so I was able to append the tenantId to the end of an email: dylan@email.com%tenantId_1 so that would create a unique email for each tenant. My would system would need to manage appending tenant Id to emails on signup, login, etc.
Simple, but I feel like there is something I missing where this may become an issue later on. It would work with the account linking feature that hopefully gets done soon! ๐
B.) Each tenant gets their database in a shared DB. Then dynamically route requests to the tenant DB with ST. But have no idea how to do that or if thats possible. Other idea is each gets their own ST core install, but not sure how to do that at scale with hundreds or thousands of tenants. Would updates need to be made to each tenant install? No idea.
Any help or insights would be great!!