Get Started
Building your own UI
If you don’t want to use the Ponder widget but build your own UI, follow this guide
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 :
connect()
- Call this function to start a web calldisconnect()
- Call this function to stop a web callonConnected(() => {})
- Callback event called when the assistant is connected and starts listeningonDisconnected(() => {})
- Callback event called when the assistant is disconnected and stops listeningonSpeechStart(() => {})
- Callback function for the event when user speech start is detectedonSpeechEnd(() => {})
- same, but for when user speech end is detectedonMessage((msg) => {})
- Callback function whenever a new messages is added to the conversationonFunctionCall((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.