mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-04 13:03:37 +00:00
fix: add beta flag to kv share docs to match kvhandle beta status (#4337)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Maintain Release Merge PR / update-release-pr (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
release-please / release-please (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Maintain Release Merge PR / update-release-pr (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
release-please / release-please (push) Canceled after 0s
This commit is contained in:
1 parent
3160b99f11
commit
1eb4e36cf4
26 files changed
+54
No files matched your search
@@ -102,6 +102,8 @@ Entries the other app wrote with `disableSharing` are never delivered. Marking a
|
||||
|
||||
## Sharing key-value data with another user
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
`kv:` always means your own data. When another user shares part of theirs with you using [`puter.kv.share()`](/KV/share/), you watch it through the share's **handle**, which goes where an app id would go. For a walkthrough, see [Send Live Updates to Other Users](/recipes/send-live-updates-to-other-users/).
|
||||
|
||||
```js
|
||||
|
||||
@@ -232,6 +232,8 @@ These Key-Value Store features are supported out of the box when using Puter.js:
|
||||
|
||||
## Sharing with other users
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
A user can share the keys under a prefix with another Puter user. The user who shares is the share's owner, and the user it's shared with is its holder. The keys stay in the owner's store.
|
||||
|
||||
Pick the tool by what you want to do:
|
||||
|
||||
@@ -38,6 +38,8 @@ A plain object is read as a path map, never appended as an element: to append an
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument. It takes these properties:
|
||||
|
||||
- `handle` (String): Work on data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix. The share needs `write` access. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -36,6 +36,8 @@ Paths support dot notation, array indexes at any level (`[0]`, `items[0]`, or `s
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument. It takes these properties:
|
||||
|
||||
- `handle` (String): Work on data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix. The share needs `write` access. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -18,6 +18,8 @@ A string containing the name of the key you want to remove.
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument. It takes these properties:
|
||||
|
||||
- `handle` (String): Work on data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix. The share needs `write` access. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -25,6 +25,8 @@ The number of seconds until the key is removed from the key-value store. `0` or
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument. It takes these properties:
|
||||
|
||||
- `handle` (String): Work on data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix. The share needs `write` access. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -25,6 +25,8 @@ The Unix timestamp (in seconds) at which the key will be removed from the key-va
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument. It takes these properties:
|
||||
|
||||
- `handle` (String): Work on data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix. The share needs `write` access. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -17,6 +17,8 @@ None
|
||||
## Return value
|
||||
A `Promise` that will resolve to `true` when the key-value store has been flushed (emptied), or reject with an error on failure.
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
Flushing works only on your own store. Passing the `handle` of data another user shared with you is rejected with `kv_handle_option_invalid`. To clear a shared prefix, delete its keys with [`puter.kv.del()`](/KV/del/).
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -18,6 +18,8 @@ A string containing the name of the key you want to retrieve the value of.
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument. It takes these properties:
|
||||
|
||||
- `handle` (String): Work on data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix. The share needs `read` or `write` access. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -36,6 +36,8 @@ Paths support dot notation, array indexes at any level (`[0]`, `items[0]`, or `s
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument. It takes these properties:
|
||||
|
||||
- `handle` (String): Work on data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix. The share needs `write` access. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -35,6 +35,8 @@ If set to `true`, the returned array will contain objects with both `key` and `v
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument of the positional forms. It takes these properties:
|
||||
|
||||
- `handle` (String): List data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The share needs `read` or `write` access. The `pattern` is relative to the shared prefix and can be at most 768 bytes, and the returned keys are relative to the prefix too. The results and `total` leave out private entries. Every page of a full listing or a stream is fetched through the handle. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -4,6 +4,8 @@ description: List the key-value data other users have shared with you.
|
||||
platforms: [websites, apps, nodejs, workers]
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
Lists the live shares other users made with you, a page at a time. Each share comes with the `handle` you pass to the other [`puter.kv`](/KV/) methods to use it.
|
||||
|
||||
A share tells you its level, its app, and the owner's label. It never says who shared it or what the prefix is. To tell shares apart, read the label, or read a key the owner keeps for that, such as `meta`, through the handle. Reading needs `read` or `write` access, so a `watch` share only has its label.
|
||||
|
||||
@@ -4,6 +4,8 @@ description: List the key-value shares you made with other users, including ones
|
||||
platforms: [websites, apps, nodejs, workers]
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
Lists the shares you made with [`puter.kv.share()`](/KV/share/), a page at a time. Shares that stopped stay in the listing with `revokedAt` and `revokedBy` set, as a record of who had access and when it ended.
|
||||
|
||||
In an app, the listing has only the shares of that app's data. Outside an app, it has every share you made.
|
||||
|
||||
@@ -27,6 +27,8 @@ Paths support dot notation, array indexes at any level (`[0]`, `items[0]`, or `s
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument. It takes these properties:
|
||||
|
||||
- `handle` (String): Work on data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix. The share needs `write` access. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -56,6 +56,8 @@ The batch form rejects it with `invalid_request`.
|
||||
|
||||
#### `handle` (String) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
Pass inside the trailing options object, as in `set(key, value, { handle })`, to write into data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix, and the share needs `write` access. See [Sharing with other users](/KV/#sharing-with-other-users). The batch form takes it too. With `handle`, a key can be at most 768 bytes.
|
||||
|
||||
#### `items` (Array) (batch only)
|
||||
|
||||
@@ -4,6 +4,8 @@ description: Share the keys under a prefix with another Puter user, so they can
|
||||
platforms: [websites, apps, nodejs, workers]
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
Shares the keys under a prefix with another Puter user. The other user becomes the share's holder, and you stay its owner. The keys stay in your store, and the holder reaches them through the share.
|
||||
|
||||
Each share has a `handle`. The holder finds it with [`puter.kv.listShared()`](/KV/listShared/) and passes it as `handle` to the other [`puter.kv`](/KV/) methods. [Sharing with other users](/KV/#sharing-with-other-users) shows how a holder uses a share.
|
||||
|
||||
@@ -4,6 +4,8 @@ description: Stop sharing key-value data with another user, or remove your own a
|
||||
platforms: [websites, apps, nodejs, workers]
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
Stops a share made with [`puter.kv.share()`](/KV/share/). Either side can call it:
|
||||
|
||||
- **The owner** revokes the share. The holder loses access, and any narrower share you made with the same holder inside the same prefix stops too.
|
||||
|
||||
@@ -35,6 +35,8 @@ Paths support dot notation, array indexes at any level (`[0]`, `items[0]`, or `s
|
||||
|
||||
#### `optConfig` (Object) (optional)
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
The last argument. It takes these properties:
|
||||
|
||||
- `handle` (String): Work on data another user shared with you, using the `handle` from [`puter.kv.listShared()`](/KV/listShared/). The key is then relative to the shared prefix. The share needs `write` access. See [Sharing with other users](/KV/#sharing-with-other-users).
|
||||
|
||||
@@ -40,6 +40,8 @@ What the request is about. The resource decides which details are accepted and w
|
||||
| `'backgroundEvents'` | `Resource.BACKGROUND_EVENTS` | None | `true` if granted |
|
||||
| `'kvShare'` | `Resource.KV_SHARE` | `{ prefix, access }` | `true` if granted |
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
#### `details` (object) (optional)
|
||||
|
||||
The fields the resource takes:
|
||||
|
||||
@@ -186,6 +186,8 @@ Before the provider runs, the balance must cover every page the call can be bill
|
||||
|
||||
### Key-value store
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
| Limit | Paid | Free | Anonymous |
|
||||
| ------------------------------- | ---- | ---- | --------- |
|
||||
| `get` / `set` / etc. per 10 s | 400 | 400 | 200 |
|
||||
@@ -422,6 +424,8 @@ See [Events](/Events/) for an overview, [`onLocal()`](/Events/subjects/#gaps) fo
|
||||
|
||||
#### What an account can hold
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
| Limit | Scope | Paid | Free | Anonymous |
|
||||
| ------------------------------------ | ------------------ | ---- | ---- | --------- |
|
||||
| Persistent subscriptions | Per user, all apps | 500 | 100 | 0 |
|
||||
|
||||
@@ -5,6 +5,8 @@ tags: [kv, events, perms]
|
||||
order: 22
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
A group chat usually needs a server that stores the messages and sends each new
|
||||
one to everyone in the room. With [`puter.kv.share()`](/KV/share/), the room can
|
||||
live in the Puter account of the user who creates it instead. Each member gets
|
||||
|
||||
@@ -5,6 +5,8 @@ tags: [kv, perms]
|
||||
order: 18
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
A fitness app keeps each user's workouts in their own Puter account. A user who
|
||||
trains with a coach wants the coach to see the log, but not change it. With
|
||||
[`puter.kv.share()`](/KV/share/) and read access, the coach can read and list
|
||||
|
||||
@@ -5,6 +5,8 @@ tags: [kv, perms]
|
||||
order: 21
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
Once users share data in your app, they need a way to see who has it and to
|
||||
take it back. This recipe builds two screens, a "People with access" panel for
|
||||
the data a user shared and a "Shared with me" list for the data other people
|
||||
|
||||
@@ -5,6 +5,8 @@ tags: [kv, events]
|
||||
order: 19
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
A scoreboard app keeps the score of a game in the scorekeeper's Puter account.
|
||||
Fans want to see each change as it happens. With a watch share, another Puter
|
||||
user gets an [event](/Events/) each time a key under a prefix changes, with the
|
||||
|
||||
@@ -5,6 +5,8 @@ tags: [kv, perms]
|
||||
order: 17
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
[`puter.kv`](/KV/) keeps each user's data in their own Puter account, where only
|
||||
they can reach it. A shared grocery list or to-do list needs two people working
|
||||
on the same data. With [`puter.kv.share()`](/KV/share/), a user can give another
|
||||
|
||||
@@ -5,6 +5,8 @@ tags: [kv, perms, workers]
|
||||
order: 23
|
||||
---
|
||||
|
||||
<div class="info">KV sharing is in beta. Method shapes, limits, and behavior may change between releases.</div>
|
||||
|
||||
Some apps share data without the user clicking a share button. A team chat app
|
||||
can share each new room with the whole team as soon as it's created, or a
|
||||
backend can add a member to a room when your own rules say so. In both cases your app calls
|
||||
|
||||
Reference in new issue
Block a user