Skip to content

Conversation

@sahilsuman933
Copy link
Contributor

Description

  • Added an example demonstrating client-side tool implementation using the Vapi Web SDK.
  • Showcases how to define a tool directly in the vapi.start() configuration without a serverUrl, making it a client-side tool.
  • Illustrates how to listen for tool-calls messages via vapi.on('message') to trigger client-side UI updates.
  • Emphasizes that client-side tools are for UI side-effects and do not send responses back to the model.
  • Includes an example of using vapi.addMessage to inject additional context into the conversation.

Testing Steps

  • Run the app locally using fern docs dev or navigate to preview deployment
  • Start a call by clicking "Start Call".
  • Ask the assistant to update the UI (e.g., "Can you show a message?", "Please refresh the screen").
  • Verify that a notification appears at the top of the screen, indicating a UI update.

Open in Cursor Open in Web

Explain handling tool-calls in-browser without server URL, clarify that client tools cannot return results to the model, and show how to inject context via addMessage. Includes complete React example and next steps to server-based tools.
Use <YOUR_PUBLIC_KEY> to avoid leaking credentials in example.
Expose new page at /tools/client-side-websdk under Tools section.
@cursor
Copy link

cursor bot commented Oct 28, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@github-actions
Copy link
Contributor

@sahilsuman933 sahilsuman933 enabled auto-merge (squash) October 28, 2025 19:05
@sahilsuman933 sahilsuman933 merged commit 34a28c4 into main Oct 28, 2025
6 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.

3 participants