Skip to content

docs(platform): examples for every useChat function - #353

Merged
wixysam merged 2 commits into
mainfrom
platform-react-docs-examples
Oct 22, 2026
Merged

wixysam merged 2 commits into
mainfrom
platform-react-docs-examples

Conversation

@wixysam

@wixysam wixysam commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Adds an example to every function on the useChat reference page, each on the member it shows. Only two of the backend functions are still missing one.

Returned actions

  • send() sends a prompt from a form, and notes that prompts sent while the AI works wait in the queue.
  • create() creates the app from the first prompt with appId set to null, keeps the new ID from onAppCreated, and sends the next prompts to it.
  • clearError() renders an error banner and hides its dismiss button when error.code is build_failed, since clearError() doesn't clear a failed build.

Questions

  • answer() renders a button per option and calls question.answer([[label]]), which shows the string[][] shape of picked.
  • submit() renders one input per secret and submits the values keyed by each field's name.
  • approve() shows the action and its reason, with Allow and Decline buttons.
  • Each decline() gets a one-line Skip or Decline button.

Backend calls

  • createApp() and openLiveSession() show the server route each one calls: Create app with a personal access token, and Create socket session with a workspace API key, returning the three session fields and keeping session_id on the server.
  • sendMessage() and submitToolCallInput() don't have one yet. Base44 holds those requests open until the turn ends, and how a backend should answer them is still an open question.

Every example type-checks in strict mode against the package's types. npm test in packages/platform passes.

Follow-up to #346.

🤖 Generated with Claude Code

…or()

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.56-pr.353.5c12c6c

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.56-pr.353.5c12c6c"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.56-pr.353.5c12c6c"
  }
}

Preview published to npm registry — try new features instantly!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available! (@base44/platform)


Install this PR's preview build with npm:

npm i @base44-preview/platform@0.5.0-pr.353.5c12c6c

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/platform:

npm i "@base44/platform@npm:@base44-preview/platform@0.5.0-pr.353.5c12c6c"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/platform": "npm:@base44-preview/platform@0.5.0-pr.353.5c12c6c"
  }
}

Preview published to npm registry — try new features instantly!

…nd two backend routes

send(), create(), approve(), and each decline() get an example, and createApp() and openLiveSession() get the server route each one calls. The routes for sendMessage() and submitToolCallInput() wait on how a backend should answer Base44's long-running chat requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wixysam wixysam changed the title docs(platform): useChat examples for answer(), submit(), and clearError() docs(platform): examples for every useChat function Oct 22, 2026
@wixysam
wixysam merged commit a73daf8 into main Oct 22, 2026
7 of 8 checks 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.

2 participants