Skip to content

API Reference

frac exports hooks and utilities from @usefractal/frac/web that work across multiple runtimes. See the compatibility matrix below for platform-specific availability.

data-llm

Sync view UI state with the model for contextual responses

All hooks and utilities are exported from @usefractal/frac/web:

import {
createStore,
useCallTool,
useDisplayMode,
useFiles,
useLayout,
useSetOpenInAppUrl,
useAppsSdkContext,
useMcpAppContext,
useOpenExternal,
useRequestModal,
useRequestSize,
useSendFollowUpMessage,
useToolInfo,
useUser,
useViewState,
} from "@usefractal/frac/web";

frac supports two runtime environments: Apps SDK (ChatGPT) and MCP Apps (open specification). Most hooks work in both, but some features are platform-specific.

Hook / FeatureApps SDKMCP AppsNotes
useToolInfo
useViewState⚠️MCP Apps: polyfilled; state doesn’t persist across view renders
data-llm⚠️MCP Apps: polyfilled (same limitation as useViewState)
useCallTool
useSendFollowUpMessage
useOpenExternal
useLayout
useUser
useDisplayMode
useFilesApps SDK only
useSetOpenInAppUrlApps SDK only
useRequestModal⚠️MCP Apps: polyfilled; renders in iframe instead of host modal
useRequestSizeMCP Apps only
useAppsSdkContextApps SDK only
useMcpAppContextMCP Apps only