Skip to main content

@dialstack/sdk / react / DialstackComponentsProvider

Variable: DialstackComponentsProvider

const DialstackComponentsProvider: React.FC<DialstackComponentsProviderProps>;

Defined in: sdk/src/react/DialstackComponentsProvider.tsx:46

Provider component that makes DialStack instance available to child components

Example

const dialstack = await loadDialstackAndInitialize({
publishableKey: 'pk_test_...',
fetchClientSecret: async () => {
const res = await fetch('/api/dialstack/session');
return (await res.json()).clientSecret;
}
});

<DialstackComponentsProvider dialstack={dialstack}>
<CallLogs />
<Voicemails />
</DialstackComponentsProvider>