Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/data/nav/liveobjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export default {
name: 'Object storage',
link: '/docs/liveobjects/storage',
},
{
name: 'Using the REST SDK',
link: '/docs/liveobjects/rest-sdk-usage',
},
{
name: 'Using the REST API',
link: '/docs/liveobjects/rest-api-usage',
Expand Down
6 changes: 6 additions & 0 deletions src/pages/docs/api/rest-sdk/channels.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ Provides access to the [REST Presence](/docs/presence-occupancy/presence) object

Provides access to the [PushChannel](/docs/api/realtime-sdk/push#push-channel) object for this channel which can be used to access members present on the channel, or participate in presence.

<If lang="javascript,nodejs">
#### object <a id="object" />

Provides access to the [RestObject](/docs/liveobjects/rest-sdk-usage) for this channel which can be used to read and modify LiveObjects on a channel using the REST SDK.
</If>

### Channel Methods

#### <If lang="javascript,nodejs,php,python,ruby,java,swift,objc,go,flutter">publish</If><If lang="csharp,go">Publish</If>
Expand Down
26 changes: 13 additions & 13 deletions src/pages/docs/liveobjects/rest-api-usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ LiveObjects provides a comprehensive REST API that enables you to directly work

View the REST API [authentication](/docs/api/liveobjects-rest#authentication) documentation for details on how to authenticate your requests.

To use LiveObjects, an API key must have at least the `object-subscribe` capability. With only this capability, clients will have read-only access, preventing them from publishing operations.
To read objects on a channel, an API key must have the `object-subscribe` [capability](/docs/auth/capabilities). With only this capability, clients have read-only access, preventing them from publishing operations.

In order to create or update objects, make sure your API key includes both `object-subscribe` and `object-publish` [capabilities](/docs/auth/capabilities) to allow full read and write access.
To create or update objects, the API key must have the `object-publish` capability. Include both `object-subscribe` and `object-publish` for full read and write access.

## Fetching objects <a id="fetching-objects"/>

Expand All @@ -26,11 +26,11 @@ The REST API returns objects in two formats:
| Format | Query parameter | Description |
|--------|----------------|-------------|
| **Compact** (default) | None | Values-only representation without metadata. Ideal for reading data values. |
| **Non-compact** | `compact=false` | Full structure including object IDs and type metadata. Useful for debugging. |
| **Full** | `compact=false` | Full structure including object IDs and type metadata. Useful for debugging. |

**Compact format** returns the logical structure of your data as a JSON object. [LiveMap](/docs/liveobjects/map) instances appear as JSON objects with their entries, and [LiveCounter](/docs/liveobjects/counter) instances appear as numbers.

**Non-compact format** includes additional [metadata](/docs/liveobjects/concepts/objects#metadata) for each object:
**Full format** includes additional [metadata](/docs/liveobjects/concepts/objects#metadata) for each object:
- Object IDs for each instance
- Object type metadata (map semantics, counter values)
- Complete object hierarchy
Expand Down Expand Up @@ -238,7 +238,7 @@ When using path operations, the server resolves object IDs at the time it receiv
</Aside>

<Aside data-type='further-reading'>
See [PathObject](/docs/liveobjects/concepts/path-object) for details on path-based access in client SDKs.
See [PathObject](/docs/liveobjects/concepts/path-object) for details on path-based access in realtime client SDKs.
</Aside>

### Available operations <a id="operation-types"/>
Expand Down Expand Up @@ -546,7 +546,7 @@ When using `path` with a create operation, the server constructs two operations
1. A `mapCreate` or `counterCreate` operation to create the new object
2. A `mapSet` operation to assign the new object to the parent `LiveMap` at the specified path

This ensures the new object is immediately [reachable](#object-reachability) from the root.
This ensures the new object is immediately [reachable](#object-reachability) from the channel object.

The response will include the object IDs of all objects affected by the resulting set of operations.
The newly created object's ID will be the first item in the list:
Expand Down Expand Up @@ -632,7 +632,7 @@ There are additional operations for creating objects with client-generated IDs:
{
"objectId": "map:Qj2kkvprTybCY5mkNMcm31hhNKZCDWqcz45LjYvCABs@1769079911168",
"mapCreateWithObjectId": {
"initialValue": "{\"entries\":{\"name\":{\"data\":{\"string\":\"Alice\"}},\"age\":{\"data\":{\"number\":30}}}}",
"initialValue": "{\"semantics\":0,\"entries\":{\"name\":{\"data\":{\"string\":\"Alice\"}},\"age\":{\"data\":{\"number\":30}}}}",
"nonce": "random-nonce-abc123"
}
}
Expand Down Expand Up @@ -677,7 +677,7 @@ For example:
-d '{
"objectId": "map:Qj2kkvprTybCY5mkNMcm31hhNKZCDWqcz45LjYvCABs@1769079911168",
"mapCreateWithObjectId": {
"initialValue": "{\"entries\":{\"name\":{\"data\":{\"string\":\"Alice\"}},\"age\":{\"data\":{\"number\":30}}}}",
"initialValue": "{\"semantics\":0,\"entries\":{\"name\":{\"data\":{\"string\":\"Alice\"}},\"age\":{\"data\":{\"number\":30}}}}",
"nonce": "random-nonce-abc123"
}
}'
Expand All @@ -686,7 +686,7 @@ For example:

#### Atomic batch with cross-references <a id="atomic-batch-cross-references"/>

Create a map and immediately link it to root in a single atomic operation:
Create a map and immediately assign it to the channel object in a single atomic operation:

<Code>
```shell
Expand All @@ -697,7 +697,7 @@ Create a map and immediately link it to root in a single atomic operation:
{
"objectId": "map:Qj2kkvprTybCY5mkNMcm31hhNKZCDWqcz45LjYvCABs@1769079911168",
"mapCreateWithObjectId": {
"initialValue": "{\"entries\":{\"name\":{\"data\":{\"string\":\"Alice\"}}}}",
"initialValue": "{\"semantics\":0,\"entries\":{\"name\":{\"data\":{\"string\":\"Alice\"}}}}",
"nonce": "nonce-1"
}
},
Expand Down Expand Up @@ -733,14 +733,14 @@ For example, if you create a cycle in the channel object by adding a reference t
-d '{
"objectId": "map:qZXBk8xaGqf4kwLSlR7Tj0Eqhd48WDFfb3gTAbj194k@1760448597692",
"mapSet": {
"key": "myRoot",
"key": "myObject",
"value": {"objectId": "root"}
}
}'
```
</Code>

The response will handle the cyclic reference by including the `myRoot` key in the response as a reference to the object ID of the channel object:
The response will handle the cyclic reference by including the `myObject` key in the response as a reference to the object ID of the channel object:

<Code>
```shell
Expand All @@ -755,7 +755,7 @@ The response will handle the cyclic reference by including the `myRoot` key in t
"votes": {
"down": 5,
"up": 10,
"myRoot": {
"myObject": {
"objectId": "root"
}
}
Expand Down
Loading