useSuperinterfaceContext

Use the useSuperinterfaceContext hook to get current Superinterface context.
app.tsx
import { SuperinterfaceProvider, useSuperinterfaceContext, } from '@superinterface/react' const App = () => { const { variables } = useSuperinterfaceContext() return ( <> {variables.assistantId} </> ) } export const Layout= ()=> ( <SuperinterfaceProvider variables={{ assistantId: 'asst_123' }} > <App /> </SuperinterfaceProvider> )

Arguments

No parameters available.

Returns

Here's a summary of useSuperinterfaceContext return properties:
PropExampleType
baseUrlhttps://localhost:3000/apiString
variables{ assistantId: 'asst_123' }Object
defaultOptions{ mutations: { enabled: false } }DefaultOptions
Good to know:
useSuperinterfaceContext returns the whole Superinterface context.