PipecatClient
in a React application. The new client introduces simplified configuration and improved client-server messaging. For an overview of the changes, see the top-level RTVIClient Migration Guide.
Key Changes
1. Package and Class Names
Old2. React Components and Hooks
Old3. Client and Transport Configuration
Old4. Connection Method
Previously,connect()
was called on the client instance without parameters. Now, you provide connection parameters directly to the connect()
method. This allows for more flexibility and customization of the connection process. For ease of use, we’ve also introduced a startBot()
and startBotAndConnect()
method where you can provide an API endpoint that returns the connection parameters.
Old
startBotAndConnect()
):
- Direct Connection: Provide the connection details directly to
connect()
.
- Using startBot(): Fetch connection details from an API endpoint and pass them to
connect()
.
- Using startBotAndConnect(): Fetch connection details and connect in one step.
5. Function Call Handling
OldBreaking Changes
- Configuration Structure: Connection parameters are now passed to connect() instead of constructor
- Helper System: Removed in favor of direct
PipecatClient
member functions or client-server messaging. - Component Names: All React components renamed from RTVI prefix to Pipecat prefix
- Hook Names: All React hooks renamed from useRTVI prefix to usePipecat prefix
Migration Steps
- Update package imports to use new names
- Move connection configuration from constructor to startBot()/startBotAndConnect()/connect() methods
- Replace any helper classes with corresponding
PipecatClient
methods or custom messaging - Update React component and hook names
- Update any TypeScript types referencing old names