diff --git a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx index b197b8b6..8fedfda6 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx @@ -31,9 +31,7 @@ resp = call.get() # user ID of an existing user user_id = 'jane' client.upsert_users( - users={ - user_id: {'id': user_id} - } + UserRequest(id=user_id) ) # the token will be valid for 1 hour diff --git a/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx b/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx index 88055054..72355784 100644 --- a/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx +++ b/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx @@ -40,12 +40,9 @@ await client.upsertUsers({ ```py -users = {} -user = UserRequest( -id='user_id', role="user", custom={"color": "red"}, name="This is a test user",image= "link/to/profile/image", +client.upsert_users(UserRequest( + id='user_id', role="user", custom={"color": "red"}, name="This is a test user",image= "link/to/profile/image",) ) -users[user.id] = user -client.upsert_users(users=users) ``` @@ -95,8 +92,7 @@ client.updateUsersPartial({ ```py -users = {} -user = UserRequest( +client.upsert_users(UserRequest( id= 'userid', role= 'user', custom= { @@ -104,16 +100,13 @@ user = UserRequest( }, name= 'This is a test user', image= 'link/to/profile/image', -) - -users[user.id] = user -client.upsert_users(users=users) +)) # or client.update_users_partial( users= [ { - id: user.id, + id: 'userid', set: { color: 'blue', }, diff --git a/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx b/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx index eaf1a01f..936b2f88 100644 --- a/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx +++ b/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx @@ -122,12 +122,9 @@ client.createToken(userId, exp); ```py -users = {} -user = UserRequest( -id="john", role="user", custom={"color": "red"}, name="John",image= "link/to/profile/image", +client.upsert_users(UserRequest( + id="john", role="user", custom={"color": "red"}, name="John",image= "link/to/profile/image",) ) -users[user.id] = user -client.upsert_users(users=users) # the token will be valid for 1 hour exp = int(time.time()) + 60 * 60