App User
create_app_user
Create a new Chainlit Application user.
Parameters
app_user
AppUser
The information of the app user to be created.
Returns
persisted_app_user
Optional[PersistedAppUser]
requiredThe created app user information if successful, None otherwise.
Example
Code Example
from chainlit.client.cloud import chainlit_client
from chainlit.types import AppUser
app_user = AppUser(
username="john_doe",
role="user",
tags=["tag1", "tag2"],
provider="provider1",
image="https://example.com/john_doe.png"
)
persisted_app_user = await chainlit_client.create_app_user(app_user)
if persisted_app_user:
print(f"App user created: {persisted_app_user.username}")
else:
print("Failed to create app user.")
Was this page helpful?