organisations implementation
# support-questions
d
Hello to all, I use the email/password login and want to embed users into an organisation based on the domain of the email. Then I want to provide users with different views in the frontend based on the organisation. How can I implement this? Thank You
r
hey @derbernd this requires our multi tenancy feature. We will be launching it very soon (within a month hopefully)
d
Okay, good to know! So I wait implementing this feature.
r
but you can sort of do it now as well. Since the org is based on the email's domain, you can still just put all the user's in the same pool
about the frontend being different, you can always build custom components around our pre built one which is based on the domain of the email entered.
you can embed our pre built component in a page and have that page look different for different orgs
d
I didn’t find informations on using pools. Where can I find some information?
r
that's not there at the moment (that's the multi tenancy feature i was talking about)
right now all the user's are in the same pool. Uniquely identified by their email ID
but since you are identifying orgs based on email domains, each email will be globally unique anyway
so you don't really need pools
d
Ah okay
I would like to continue to store information such as name, phone number and so on per user. Do I prefer to use an external database for this or can I also implement this in Supertokens?
r
you could do that, or you could use our user metadata feature as well.
d
Is there an example for using metadata in python (FastAPI)?
for asyncio python:
Copy code
from supertokens_python.recipe.usermetadata.asyncio import update_user_metadata


async def some_func():
    user_id = "..."

    await update_user_metadata(user_id, {
        "newKey": "data"
    })
for syncio:
Copy code
from supertokens_python.recipe.usermetadata.syncio import update_user_metadata

user_id = "..."

update_user_metadata(user_id, {
    "newKey": "data"
})
And then you can get the metadata like this:
Copy code
from supertokens_python.recipe.usermetadata.asyncio import get_user_metadata


async def some_func():
    user_id = "..."

    metadataResult = await get_user_metadata(user_id)
    exampleValue = metadataResult.metadata["exampleKey"]
    print(exampleValue)
Or for syncio, like this:
Copy code
from supertokens_python.recipe.usermetadata.syncio import get_user_metadata

user_id = "..."

metadataResult = get_user_metadata(user_id)
exampleValue = metadataResult.metadata["exampleKey"]
print(exampleValue)
d
Thank you