Thread

Use the <Thread> component to render the thread for chatting with assistant.
app.tsx
import { SuperinterfaceProvider, Thread, } from '@superinterface/react' export const App = () => ( <SuperinterfaceProvider> <Thread /> </SuperinterfaceProvider> )

Props

Here's a summary of the props available for the <Thread> component:
PropExampleTypeRequired
variablesvariables={{ threadId: 'thread_123' }}ObjectNo

variables

app.tsx
import { SuperinterfaceProvider, Thread, } from '@superinterface/react' export const App = () => ( <SuperinterfaceProvider> <Thread variables={{ threadId: 'thread_123' }} /> </SuperinterfaceProvider> )
When you set variables, these things happen:
    variables are merged into all child Superinterface query and mutation keys as the second parameter (e.g. const [keyBase, { threadId }] = queryKey and const [keyBase, { threadId }] = mutationKey). This allows you to use variables in all child queryFn functions.
    variables are merged into all child Superinterface mutation variables. This allows you to use variables in all child mutationFn functions.