You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/admin-api.mdx
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ order: 90
5
5
6
6
## Admin API
7
7
8
-
Yorkie Admin API allows developers to interact programmatically with their Yorkie documents without using Yorkie SDK. It is convenient for managing documents in server-side applications.
8
+
The Yorkie Admin API allows developers to interact programmatically with their Yorkie documents without using the Yorkie SDK. It is convenient for managing documents in server-side applications.
9
9
10
10
The API is implemented using [Connect protocol](https://connectrpc.com/docs/protocol/), which means all requests are made using HTTP POST method to a specific service endpoint. The API accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.
This endpoint creates a new document in the specified project. If `initial_root`
30
-
is provided, it will be used as the initial content of the document. Otherwise, an empty document will be created.
29
+
This endpoint creates a new document in the specified project. If `initial_root` is provided, it is used as the initial content of the document. Otherwise, an empty document is created.
This endpoint returns a list of documents in a project. There is a pagination mechanism to retrieve documents in batches.
103
-
You can provide the `previous_id` of the last document in the previous page to get the next page of documents.
101
+
This endpoint returns a list of documents in a project. A pagination mechanism allows you to retrieve documents in batches. Provide the `previous_id` of the last document in the previous page to get the next page of documents.
104
102
105
-
If you want to get the root of the document, you can set the `include_root` parameter to `true`.
103
+
To include the root of each document in the response, set the `include_root` parameter to `true`.
This endpoint retrieves channel information without requiring an SDK client to attach to the channels. It returns the session count (number of connected clients) for the specified channels.
329
+
This endpoint retrieves channel information without requiring an SDK client to attach to the channels. It returns the session count (the number of connected clients) for the specified channels.
332
330
333
331
Channels support [hierarchical keys using periods (`.`) as separators](/docs/js-sdk#hierarchical-channel-keys). When `include_sub_path` is enabled, the session count includes all clients connected to sub-level channels.
Copy file name to clipboardExpand all lines: docs/advanced/security.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Each project in Yorkie can have its own allowed origins settings, which can be m
21
21
22
22
### Auth Webhook
23
23
24
-
The Auth Webhook provides fine-grained access control by validating client requests through an external authentication server. This allows you to enforce custom authorization logic, ensuring that only authorized users can access and modify Yorkie documents.
24
+
The Auth Webhook provides fine-grained access control by validating client requests through an external authentication server. This allows you to enforce custom authorization logic, ensuring only authorized users can access and modify Yorkie documents.
25
25
26
26
<Mermaid
27
27
chart={`sequenceDiagram
@@ -49,17 +49,17 @@ The authentication process follows these steps:
49
49
50
50
##### 1. Configure the Auth Webhook
51
51
52
-
You can easily set up the Auth Webhook via the the [Dashboard]({{DASHBOARD_PATH}}):
52
+
You can set up the Auth Webhook via the [Dashboard]({{DASHBOARD_PATH}}):
53
53
- Go to the Project Settings page.
54
54
- Set the webhook URL and define which methods require authentication.
Alternatively, you can configure the webhook using the Yorkie CLI. See updating the project for details. Refer to the [updating the project](/docs/cli#updating-the-project).
58
+
Alternatively, configure the webhook using the Yorkie CLI. See [Updating the Project](/docs/cli#updating-the-project) for details.
59
59
60
60
##### 2. Client Configuration
61
61
62
-
To provide authentication tokens dynamically, use the `authTokenInjector` option when creating a Yorkie client:
62
+
Provide authentication tokens dynamically using the `authTokenInjector` option when creating a Yorkie client:
63
63
64
64
```javascript
65
65
constclient=newyorkie.Client({
@@ -109,7 +109,7 @@ HTTP Status Codes:
109
109
110
110
##### 5. Error Handling and Recovery
111
111
112
-
Yorkie handles authentication failures based on the webhook response and HTTP status codes:
112
+
Yorkie handles authentication failures based on the webhook response and HTTP status codes.
113
113
114
114
| Status Code | Meaning | Action Taken |
115
115
|------------|---------|--------------|
@@ -118,9 +118,9 @@ Yorkie handles authentication failures based on the webhook response and HTTP st
118
118
| 403 Permission Denied | The token is valid but lacks the required permissions (allowed: false) | The request is rejected with `codes.PermissionDenied`|
119
119
120
120
##### Token Refresh & Retry Behavior
121
-
For `PushPull`(realtime sync) and `WatchDocuments`:
122
-
- Yorkie automatically retries the request after refreshing the token.
121
+
For `PushPull`(realtime sync) and `WatchDocuments`:
122
+
- Yorkie automatically retries the request after refreshing the token
123
123
- Notifies via [`document.subscribe('auth-error')`](/docs/js-sdk#documentsubscribeauth-error)
124
124
125
125
For other API calls:
126
-
- The system does not automatically retry; the client must manually handle the `codes.Unauthenticated` error and retry the request.
126
+
- The system does not automatically retry; the client must manually handle the `codes.Unauthenticated` error and retry the request
Copy file name to clipboardExpand all lines: docs/android-sdk.mdx
+31-32Lines changed: 31 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,13 @@ order: 50
5
5
6
6
## Android SDK
7
7
8
-
Through Yorkie Android SDK, you can efficiently build collaborative applications. On the client-side implementation, you can create Documents that are automatically synced with remote peers with minimal effort.
8
+
The Yorkie Android SDK enables you to efficiently build collaborative applications. On the client side, you can create documents that automatically sync with remote peers with minimal effort.
9
9
10
10
If you want to install the SDK, refer to the [Getting Started with Android SDK](/docs/getting-started/with-android-sdk).
11
11
12
12
### Client
13
13
14
-
`Client` is a normal client that can communicate with the server. It has Documents and sends changes of the Document from local to the server to synchronize with other replicas in remote.
14
+
`Client` is a normal client that communicates with the server. It holds documents and sends local changes to the server to synchronize with other replicas.
15
15
16
16
#### Creating a Client
17
17
@@ -31,7 +31,7 @@ val client = Client(
31
31
32
32
#### Activating a Client
33
33
34
-
Activates the client by registering it with the server. The server assigns a unique client ID that is used to distinguish different clients. After activation, the client is ready to attach documents and communicate with the server.
34
+
Activate the client by registering it with the server. The server assigns a unique client ID that distinguishes different clients. After activation, the client is ready to attach documents and communicate with the server.
35
35
36
36
```kotlin
37
37
scope.launch {
@@ -72,7 +72,7 @@ scope.launch {
72
72
73
73
#### Attaching Documents
74
74
75
-
Attaches a document to the client. Once attached, the client will synchronize the document with the server and other clients. You can set initial presence data and choose the synchronization mode.
75
+
Attach a document to the client. Once attached, the client synchronizes the document with the server and other clients. You can set initial presence data and choose the synchronization mode.
76
76
77
77
**Parameters:**
78
78
-`document`: The document to attach
@@ -93,7 +93,7 @@ scope.launch {
93
93
94
94
#### Detaching Documents
95
95
96
-
Detaches a document from the client. The client will no longer synchronize the document with the server. This is important for garbage collection to clean up CRDT tombstones.
96
+
Detach a document from the client. The client no longer synchronizes the document with the server. This is important for garbage collection to clean up CRDT tombstones.
97
97
98
98
**Parameters:**
99
99
-`document`: The document to detach
@@ -107,7 +107,7 @@ scope.launch {
107
107
108
108
#### Synchronizing Documents
109
109
110
-
Manually pushes local changes to the server and pulls remote changes. Useful when using `Manual` sync mode or when you need to force synchronization.
110
+
Manually push local changes to the server and pull remote changes. This is useful when using `Manual` sync mode or when you need to force synchronization.
111
111
112
112
**Parameters:**
113
113
-`document`: Specific document to sync. If `null`, syncs all attached documents (optional)
@@ -126,7 +126,7 @@ scope.launch {
126
126
127
127
#### Changing Synchronization Mode
128
128
129
-
Changes the synchronization mode of an attached document. This allows you to dynamically control how the document synchronizes with the server.
129
+
Change the synchronization mode of an attached document. This allows you to dynamically control how the document synchronizes with the server.
130
130
131
131
**Yorkie offers four SyncModes:**
132
132
-`Client.SyncMode.Realtime`: Local changes are automatically pushed to the server, and remote changes are pulled from the server.
Broadcasts a message to other clients subscribed to the document. This is useful for sending ephemeral messages that don't need to be stored in the document (e.g., notifications, alerts, or temporary states).
151
+
Broadcast a message to other clients subscribed to the document. This is useful for sending ephemeral messages that don't need to be stored in the document, such as notifications, alerts, or temporary states.
152
152
153
153
**Parameters:**
154
154
-`document`: The document to broadcast to
@@ -168,7 +168,7 @@ scope.launch {
168
168
169
169
#### Removing Documents
170
170
171
-
Permanently removes a document from the server. This operation is irreversible and will delete the document for all clients.
171
+
Permanently remove a document from the server. This operation is irreversible and deletes the document for all clients.
172
172
173
173
**Parameters:**
174
174
-`document`: The document to remove
@@ -181,7 +181,7 @@ scope.launch {
181
181
182
182
#### Deactivating a Client
183
183
184
-
Deactivates the client and disconnects from the server. All attached documents will be detached automatically.
184
+
Deactivate the client and disconnect from the server. All attached documents are detached automatically.
185
185
186
186
**Parameters:**
187
187
-`keepalive`: If `true`, ensures the deactivation request completes even if the app terminates (optional, default: `false`)
@@ -219,12 +219,12 @@ val client = Client(
219
219
220
220
### Document
221
221
222
-
`Document` is a primary data type in Yorkie, which provides a JSON-like updating experience that makes it easy to represent your application's model.
223
-
A `Document` can be updated without being attached to the client, and its changes are automatically propagated to other clients when the `Document` is attached to the `Client` or when the network is restored.
222
+
`Document` is the primary data type in Yorkie, providing a JSON-like updating experience that makes it easy to represent your application's model.
223
+
A `Document` can be updated without being attached to the client, and its changes automatically propagate to other clients when the `Document` is attached to the `Client` or when the network is restored.
224
224
225
225
#### Creating a Document
226
226
227
-
Creates a new document instance with a unique key. The document can be modified locally before being attached to a client.
227
+
Create a new document instance with a unique key. The document can be modified locally before being attached to a client.
228
228
229
229
**Parameters:**
230
230
-`key`: Unique identifier for the document
@@ -234,12 +234,11 @@ Creates a new document instance with a unique key. The document can be modified
234
234
val document =Document(Document.Key("my-document"))
235
235
```
236
236
237
-
> The document key is used to identify the Document in Yorkie. It is a string that can be freely defined by the user.
238
-
> However, it is allowed to use only `a-z`, `A-Z`, `0-9`, `-`, `.`, `_`, `~` and must be between 4-120 characters.
237
+
> The document key identifies the Document in Yorkie. It is a string that you can freely define, but it can only contain `a-z`, `A-Z`, `0-9`, `-`, `.`, `_`, `~` and must be between 4 and 120 characters.
239
238
240
239
#### Attaching a Document
241
240
242
-
Attaches the document to a client. Once attached, the document will be synchronized with the server and other clients. You can set initial presence and choose the sync mode.
241
+
Attach the document to a client. Once attached, the document synchronizes with the server and other clients. You can set initial presence and choose the sync mode.
243
242
244
243
```kotlin
245
244
scope.launch {
@@ -268,7 +267,7 @@ when (document.status) {
268
267
269
268
#### Updating a Document
270
269
271
-
Updates the document structure and/or presence. The updater function provides access to the document root and presence. Changes are automatically synchronized with other clients when attached.
270
+
Update the document structure and/or presence. The updater function provides access to the document root and presence. Changes automatically synchronize with other clients when attached.
272
271
273
272
**Parameters:**
274
273
-`message`: Optional description of the change
@@ -288,7 +287,7 @@ scope.launch {
288
287
289
288
**getRoot()**
290
289
291
-
Returns a proxy of the document's root object that you can use to read values.
290
+
Return a proxy of the document's root object that you can use to read values.
292
291
293
292
```kotlin
294
293
scope.launch {
@@ -300,7 +299,7 @@ scope.launch {
300
299
301
300
**getValueByPath()**
302
301
303
-
Gets a value at a specific JSON path. The path must start with `$` which represents the document root.
302
+
Get a value at a specific JSON path. The path must start with `$`, which represents the document root.
Converts the entire document to a JSON string representation.
316
+
Convert the entire document to a JSON string representation.
318
317
319
318
```kotlin
320
319
val json = document.toJson()
@@ -356,7 +355,7 @@ scope.launch {
356
355
357
356
**events(targetPath)**
358
357
359
-
Subscribe to changes for a specific path in the document. Only events affecting the target path or its nested values will be emitted.
358
+
Subscribe to changes for a specific path in the document. Only events affecting the target path or its nested values are emitted.
360
359
361
360
**Parameters:**
362
361
-`targetPath`: JSON path to subscribe to (e.g., `$.todos`, `$.user.name`)
@@ -379,7 +378,7 @@ scope.launch {
379
378
380
379
#### Changing Synchronization Mode
381
380
382
-
Changes how the document synchronizes with the server. See the [Client Changing Synchronization Mode](#changing-synchronization-mode) section for available modes and their descriptions.
381
+
Change how the document synchronizes with the server. See the [Client Changing Synchronization Mode](#changing-synchronization-mode) section for available modes and their descriptions.
383
382
384
383
```kotlin
385
384
// Enable automatic synchronization of both local and remote changes
@@ -400,7 +399,7 @@ scope.launch {
400
399
401
400
#### Detaching a Document
402
401
403
-
Detaches the document from the client. The document will no longer be synchronized with the server. This is important for efficient garbage collection to remove [CRDT tombstones](https://crdt.tech/glossary).
402
+
Detach the document from the client. The document no longer synchronizes with the server. This is important for efficient garbage collection to remove [CRDT tombstones](https://crdt.tech/glossary).
404
403
405
404
```kotlin
406
405
scope.launch {
@@ -414,7 +413,7 @@ Yorkie provides several JSON-based data types that can be used to model your app
414
413
415
414
#### JsonObject
416
415
417
-
`JsonObject` is a key-value data structure, similar to a JSON object or Kotlin Map. It can contain any JSON-compatible values including other objects, arrays, primitives, and custom CRDT types.
416
+
`JsonObject` is a key-value data structure similar to a JSON object or Kotlin Map. It can contain any JSON-compatible values, including other objects, arrays, primitives, and custom CRDT types.
418
417
419
418
**Creating and Using JsonObject:**
420
419
@@ -464,7 +463,7 @@ scope.launch {
464
463
465
464
#### JsonArray
466
465
467
-
`JsonArray` is an ordered collection of values, similar to a JSON array or Kotlin List. It supports adding, removing, and accessing elements by index.
466
+
`JsonArray` is an ordered collection of values similar to a JSON array or Kotlin List. It supports adding, removing, and accessing elements by index.
468
467
469
468
**Creating and Using JsonArray:**
470
469
@@ -541,7 +540,7 @@ scope.launch {
541
540
542
541
#### JsonText
543
542
544
-
`JsonText` is a specialized CRDT type for collaborative text editing. It supports text operations like insert, delete, and styling, making it ideal for building rich text editors.
543
+
`JsonText` is a specialized CRDT type for collaborative text editing. It supports text operations such as insert, delete, and styling, making it ideal for building rich text editors.
`JsonCounter` is a CRDT type that supports atomic increment and decrement operations. It automatically resolves conflicts when multiple clients modify the counter simultaneously.
651
+
`JsonCounter` is a CRDT type that supports atomic increment and decrement operations, automatically resolving conflicts when multiple clients modify the counter simultaneously.
653
652
654
653
**Creating and Using Counter:**
655
654
@@ -699,7 +698,7 @@ JsonCounter is ideal for:
699
698
700
699
#### JsonTree
701
700
702
-
`JsonTree` is a CRDT-based tree structure designed for representing hierarchical document structures like HTML or XML. It's ideal for building rich text editors with complex formatting (e.g., ProseMirror, Quill).
701
+
`JsonTree` is a CRDT-based tree structure designed for representing hierarchical document structures such as HTML or XML. It is ideal for building rich text editors with complex formatting (such as ProseMirror or Quill).
703
702
704
703
**Creating a Tree:**
705
704
@@ -837,7 +836,7 @@ scope.launch {
837
836
838
837
### Presence
839
838
840
-
Presence is a feature that allows you to share the temporary state of online users in real-time. Unlike document data, presence information is not stored permanently and is only maintained while users are connected. This makes it ideal for showing user cursors, selections, online status, or any other ephemeral user state.
839
+
Presence allows you to share the temporary state of online users in real-time. Unlike document data, presence information is not stored permanently and is only maintained while users are connected. This makes it ideal for showing user cursors, selections, online status, or any other ephemeral user state.
841
840
842
841
#### Setting Initial Presence
843
842
@@ -875,7 +874,7 @@ scope.launch {
875
874
876
875
#### Updating Presence
877
876
878
-
You can update presence at any time using `document.updateAsync()`. The `presence` parameter in the updater function is a `Presence` instance.
877
+
Update presence at any time using `document.updateAsync()`. The `presence` parameter in the updater function is a `Presence` instance.
879
878
880
879
**Function Signature:**
881
880
@@ -905,7 +904,7 @@ scope.launch {
905
904
906
905
**Merge Behavior:**
907
906
908
-
Presence changes are merged, not replaced. Only the specified keys are updated:
907
+
Presence changes are merged, not replaced. Only the specified keys are updated.
0 commit comments