Skip to content

Commit 3f45d82

Browse files
committed
Draft consolidated user metadata page
1 parent e7fa389 commit 3f45d82

11 files changed

+205
-20
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
You can read the user metadata of a currently logged-in user through the
2+
:dotnet-sdk:`User <reference/Realms.Sync.User.html>` object.
3+
4+
The ``Profile`` property on the ``User`` object returns a
5+
:dotnet-sdk:`UserProfile <reference/Realms.Sync.UserProfile.html>` object
6+
of a logged-in user.
7+
8+
The following example shows how to get a user's email from the metadata.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
You can read the :ref:`user metadata <user-metadata>` of a
2+
currently logged-in user through the :flutter-sdk:`User <realm/User-class.html>`
3+
object.
4+
5+
The ``profile`` property on the ``User`` object returns a
6+
:flutter-sdk:`User.profile <realm/User/profile.html>` object
7+
of a logged-in user.
8+
9+
The following example shows how to get a user's email from the metatdata.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The selected language does not provide serializable user metadata. This
2+
functionality is only available in Kotlin.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You can read the user metadata of a currently logged-in user through that
2+
user's ``User`` object.
3+
4+
To read the data, access the ``profile`` property on the ``User`` object
5+
of a logged-in user.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
You can read the user metadata of a currently logged-in user through
2+
that user's
3+
:kotlin-sync-sdk:`User <io.realm.kotlin.mongodb/-user/index.html>`
4+
object. You cannot edit user metadata through a ``User`` object.
5+
6+
To read the data, call the :kotlin-sync-sdk:`profileAsBsonDocument
7+
<io.realm.kotlin.mongodb.ext/profile-as-bson-document.html>`
8+
method on the ``User`` object of a logged-in user.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. versionadded:: 1.9.0
2+
3+
Kotlin SDK version 1.9.0 introduced an API that supports:
4+
5+
- A limited but stable EJSON encoder for user metadata returned by ``User.profileAsBsonDocument()``
6+
- An experimental EJSON encoder that supports full document serialization for user
7+
metadata returned by the :kotlin-sync-sdk:`User.profile()
8+
<io.realm.kotlin.mongodb.ext/profile.html>` extension method. This encoder
9+
and method requires experimental opt-in.
10+
11+
You must add the official
12+
`Kotlin Serialization <https://github.com/Kotlin/kotlinx.serialization>`__
13+
library to your project to use the Kotlin SDK's EJSON serialization.
14+
For more information, refer to :ref:`Serialization <sdks-serialization>`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You can read the user metadata of a currently logged-in user through that
2+
user's ``User`` object.
3+
4+
To read the data, access the ``profile`` property on the ``User`` object
5+
of a logged-in user.

source/includes/configure-user-metadata.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.. tabs-drivers::
2+
3+
tabs:
4+
- id: csharp
5+
content: |
6+
7+
.. literalinclude:: /examples/generated/dotnet/UserLinkExamples.snippet.user-metadata.cs
8+
:language: csharp
9+
10+
- id: dart
11+
content: |
12+
13+
.. literalinclude:: /examples/generated/flutter/authenticate_users_test.snippet.user-metadata.dart
14+
:language: dart
15+
16+
- id: javascript
17+
content: |
18+
19+
.. literalinclude:: /examples/generated/node/authenticate.snippet.user-metadata.js
20+
:language: js
21+
22+
- id: kotlin
23+
content: |
24+
25+
.. literalinclude:: /examples/generated/kotlin/AuthenticationTest.snippet.get-user-metadata.kt
26+
:language: kotlin
27+
28+
- id: swift
29+
content: |
30+
31+
.. literalinclude:: /examples/generated/code/start/Authenticate.snippet.read-user-metadata.swift
32+
:language: swift
33+
34+
- id: typescript
35+
content: |
36+
37+
.. literalinclude:: /examples/generated/node/authenticate.snippet.user-metadata.js
38+
:language: js

source/includes/update-user-metadata.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)