useImFusion
ts
function useImFusion(): ImFusion;Returns the initialized ImFusion SDK instance.
Throws if the SDK is not yet ready. Safe to call inside ImFusionReady.
Returns
ImFusion
The initialized ImFusion instance
Throws
If called outside of an ImFusionProvider
Throws
If called before the SDK has finished initializing
Example
tsx
function MyComponent() {
const imf = useImFusion();
return <button onClick={() => imf.render()}>Render</button>;
}