Skip to content

docs(xchat): correct chat-xdk SDK API surface across guides - #256

Merged
santiagomed merged 3 commits into
xchat-docsfrom
docs/xchat-api-accuracy
Jul 16, 2026
Merged

docs(xchat): correct chat-xdk SDK API surface across guides#256
santiagomed merged 3 commits into
xchat-docsfrom
docs/xchat-api-accuracy

Conversation

@santiagomed

Copy link
Copy Markdown
Collaborator

Rebased onto the xchat-docs branch (the chat API docs integration branch), not main.

What

Corrects API-accuracy bugs in the X Chat SDK guides against the current chat-xdk SDK, so every language tab matches the shipped API.

Bugs fixed

  • Streaming: encrypt_stream/decrypt_stream are two-arg raw-bytes calls (no {ciphertext, media_hash_key} return / 3-arg decrypt); media_hash_key comes from the media-upload finalize step.
  • Prepare methods take a single params object/struct in every binding except Python; params types dropped the Prepare prefix (PrepareGroupCreateParamsGroupCreateParams).
  • encrypt_message/encrypt_reply/reactions: TypeScript tabs now use the params object (reply uses replyToSequenceId).
  • decrypt_events .errors is a map { index → message }, not a list.
  • Go conversation keys are raw []byte; ImportKeys takes []byte; Go utility calls honor (value, error) arities.
  • Java reads the public conversationKey field (no getter); C#/Java/Rust image-dimension and conversation-key types corrected (ImageDimensions, Option<XChatConversationKey> + .to_bytes(), &XChatConversationKey).
  • Verification is fail-closed by default — corrected the statements implying it is opt-in.

Gaps added

  • Incremental streaming API (stream_encryptor/stream_decryptor; JS "never free() after finish()").
  • keyVersion-per-event → media key selection after a rotation.
  • Three Juicebox config shapes; hex utility helpers.

Verification

Every signature checked against the SDK source. Reviewer pass run; all valid findings applied (a "two juicebox shapes" finding was rejected — verified the third key_store_token_map_json branch is on chat-xdk main). All <Tabs>/<Tab> blocks balanced.

Fix API-accuracy bugs against the current SDK: streaming is a two-arg
raw-bytes call (media_hash_key comes from upload finalize, not
encrypt_stream); prepare methods take a single params object/struct in
every binding except Python (and the params types dropped the Prepare
prefix); decrypt_events .errors is a map, not a list; Go conversation
keys are raw bytes, not base64; verification is fail-closed by default.
Add the incremental streaming API, the keyVersion-per-event media key
selection contract, the three Juicebox config shapes, and the hex
utility helpers.
Address code-review findings on the API-accuracy pass: TypeScript
encrypt_message/encrypt_reply/reactions take a single params object;
Go import_keys takes raw bytes (decode the base64 env var first); Go
utility calls honor their (value, error) arities; Java reads the public
conversationKey field, not a getter; C#/Java/Rust image-dimension and
conversation-key types match the SDK; width/height casts added where
narrowing.
State the conversation key as plain raw bytes without phrasing that
implies a prior encoding, and remove code comments that only restate a
variable's type.
@santiagomed
santiagomed merged commit 85a5f21 into xchat-docs Jul 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant