@poolse/sdk 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +11 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -103,12 +103,14 @@ chat.conversations.one(id): ConversationHandle;
103
103
  name?: string | null;
104
104
  avatar_url?: string | null;
105
105
  member_limit?: number | null;
106
- member_external_ids?: string[]; // your IDs; poolse looks them up by tenant
106
+ member_external_ids?: string[];
107
107
  custom_data?: Record<string, unknown>;
108
108
  settings?: Record<string, unknown>;
109
109
  }
110
110
  ```
111
111
 
112
+ `member_external_ids` is your tenant's own ids — poolse looks them up by tenant and lazily provisions any that don't exist yet. The returned `Conversation` carries `member_external_ids` (the array of external_ids for every member) and `last_message_preview` (server-denormalized first ~80 chars of the most recent message body, used to render inbox rows without a per-row decrypt round-trip).
113
+
112
114
  `ConversationHandle` (returned by `chat.conversations.one(id)`):
113
115
 
114
116
  ```ts
@@ -300,11 +302,16 @@ Payload shapes are exact:
300
302
  Returned by `chat.realtime.user(id)`. Only the user matching the JWT can join their own channel — the server rejects other ids.
301
303
 
302
304
  ```ts
303
- channel.onMention(fn): Unsubscribe; // mention:new
304
- channel.onConversationCreated(fn): Unsubscribe; // conversation:created
305
+ channel.onMention(fn): Unsubscribe;
306
+ channel.onConversationCreated(fn): Unsubscribe;
307
+ channel.onConversationUpdated(fn): Unsubscribe;
305
308
  ```
306
309
 
307
- `mention:new` carries `{ message_id, conversation_id, sender_id }` — fetch the full message via REST if you need the body. `conversation:created` fires whenever the user is added to a conversation (including ones they created themselves) and carries the full `Conversation`.
310
+ `onMention` corresponds to the `mention:new` push and carries `{ message_id, conversation_id, sender_id }` — fetch the full message via REST if you need the body.
311
+
312
+ `onConversationCreated` corresponds to the `conversation:created` push, which fires whenever the user is added to a conversation (including ones they created themselves) and carries the full `Conversation` row with `member_external_ids` preloaded.
313
+
314
+ `onConversationUpdated` corresponds to the `conversation:updated` push and fires after every message sent in any of the user's conversations. Payload shape is `{ conversation: Conversation, by_user_id: Uuid | null }` — `by_user_id` is the sender's id, so a client can avoid bumping its own unread when the server already advanced its read cursor in the same transaction. The `conversation` carries the freshly written `last_message_preview`, `last_message_at`, and `last_sequence` so an inbox UI can update without a refetch.
308
315
 
309
316
  ## Token caching
310
317
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poolse/sdk",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Headless TypeScript SDK for poolse — realtime chat infrastructure. REST + WebSocket, framework-agnostic. Use directly, or via @poolse/react.",
5
5
  "license": "MIT",
6
6
  "keywords": [