Skip to main content
Wrap your _app.js or equivalent file in the PonderProvider - and pass in the headless prop, along with assistantId and host This will make the Ponder widget not render anywhere, but still give you access to its functionality
Now you can use the usePonder hook anywhere in your app for access the Ponder assistant. the usePonder hook exposes the following methods that will let you build your own UI :
  1. connect() - Call this function to start a web call
  2. disconnect() - Call this function to stop a web call
  3. onConnected(() => {}) - Callback event called when the assistant is connected and starts listening
  4. onDisconnected(() => {}) - Callback event called when the assistant is disconnected and stops listening
  5. onSpeechStart(() => {}) - Callback function for the event when user speech start is detected
  6. onSpeechEnd(() => {}) - same, but for when user speech end is detected
  7. onMessage((msg) => {}) - Callback function whenever a new messages is added to the conversation
  8. onFunctionCall((name, args) => {}) - Callback whenever the assistant decides to call a function
For example, here is a minimal “Talk to us” button
Refer to the API Reference page for full reference.