Flowstack SDK
type: SoftwareApplication
application category: DeveloperApplication
operating system: Web, Node.js
software version: 0.3.3
offers: Offer
  price: 0
  price currency: USD
license: https://opensource.org/licenses/MIT

FlowstackProvider
type: APIReference
description: The root provider that wraps a built app and supplies backend config (baseUrl, tenantId, mode, appScope) to all Flowstack hooks.
article section: built-apps
keywords: provider, built-apps, Flowstack SDK, useFlowstack, BrokeredLoginButton, AuthGuard, useCollection, useAgent
is part of: Flowstack SDK
programming model: <FlowstackProvider config={config}>{children}</FlowstackProvider>
example of work: Minimal built-app wrap
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { FlowstackProvider, useFlowstack, BrokeredLoginButton } from 'flowstack-sdk'; function App() { return ( <FlowstackProvider config={{ baseUrl: 'https://sage-api.flowstack.fun', mode: 'production', appScope: '__SITE_ID__', // Hex site ID — auto-filled by build pipeline // No tenantId — derived from the brokered-login JWT. }}> <AuthGate /> </FlowstackProvider> ); }
example of work: Casino platform wrap
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { FlowstackProvider } from 'flowstack-sdk'; const config = { baseUrl: 'https://sage-api.flowstack.fun', tenantId: 't_6fe54402be43', mode: 'production', jwtSecret: 'flowstack-cdn-site', passwordSecret: 'flowstack-cdn-site', }; export default function App({ children }) { return ( <FlowstackProvider config={config}> {children} </FlowstackProvider> ); }
is related to: useFlowstack
is related to: BrokeredLoginButton
is related to: AuthGuard
is related to: useCollection
is related to: useAgent

useFlowstack
type: APIReference
description: The hook built apps use to read auth state — isAuthenticated, isInitialized, and credentials — instead of useAuth().
article section: built-apps
keywords: hook, built-apps, Flowstack SDK, BrokeredLoginButton, AuthGuard, useAuth, FlowstackProvider
is part of: Flowstack SDK
programming model: const { isAuthenticated, isInitialized, credentials, setCredentials } = useFlowstack()
example of work: Gate UI on auth state
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: function AuthGate() { const { isAuthenticated, isInitialized } = useFlowstack(); if (!isInitialized) return Loading... ; // BrokeredLoginButton opens Casino's auth popup — Privy runs there, not here return isAuthenticated ? <MainApp /> : ( <BrokeredLoginButton label="Continue with Flowstack" /> ); }
example of work: Read identity and sign out
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: function Header() { const { credentials, setCredentials } = useFlowstack(); return ( {credentials?.email} setCredentials(null)}>Sign out ); }
is related to: BrokeredLoginButton
is related to: AuthGuard
is related to: useAuth
is related to: FlowstackProvider

BrokeredLoginButton
type: APIReference
description: The only authentication method for built apps — a button that opens Casino's auth popup where Privy runs and posts a scoped JWT back to the app.
article section: auth
keywords: component, auth, Flowstack SDK, useFlowstack, AuthGuard, useAuth, FlowstackProvider
is part of: Flowstack SDK
programming model: <BrokeredLoginButton label?="..." />
example of work: Login page
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useFlowstack, BrokeredLoginButton } from 'flowstack-sdk'; function LoginPage() { // No email, no password, no Privy appId needed here return ( Welcome <BrokeredLoginButton label="Continue with Flowstack" /> ); }
is related to: useFlowstack
is related to: AuthGuard
is related to: useAuth
is related to: FlowstackProvider

AuthGuard
type: APIReference
description: Wrapper that renders children only when authenticated — showing a login fallback, or transparently issuing a guest session for opted-in built apps.
article section: auth
keywords: component, auth, Flowstack SDK, BrokeredLoginButton, useFlowstack, useAuthGuard, useAuth
is part of: Flowstack SDK
programming model: <AuthGuard fallback={<LoginScreen />}>{children}</AuthGuard>
example of work: Guard with a login fallback
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { AuthGuard } from 'flowstack-sdk'; export default function App() { return ( <AuthGuard fallback={<LoginScreen />}> <Console /> </AuthGuard> ); } // LoginScreen shows BrokeredLoginButton function LoginScreen() { return ( <BrokeredLoginButton /> ); }
is related to: BrokeredLoginButton
is related to: useFlowstack
is related to: useAuthGuard
is related to: useAuth

useCollection
type: APIReference
description: Direct MongoDB CRUD for built-app data — the primary, reactive data hook for tables, forms, cards, and persistence.
article section: data
keywords: hook, data, Flowstack SDK, usePublicCollection, useAgent, useDatasets, useQuery, two-layer-data-model
is part of: Flowstack SDK
assembly version: 0.1.0
programming model: const { documents, count, total, isLoading, error, refresh, insert, update, remove } = useCollection<T>(name, options?)
example of work: Reactive query
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: function TransactionTable() { const { documents, isLoading } = useCollection<Transaction>('transactions', { sort: { date: -1 }, limit: 50, refreshOnAgentComplete: true, }); if (isLoading) return Loading... ; return ( {documents.map(row => ( {row.date} ${row.amount} ))} ); }
example of work: Insert on form submit
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { insert } = useCollection('transactions'); await insert({ ...form, amount: Number(form.amount), created_at: new Date().toISOString() }); // All useCollection('transactions') instances auto-refresh
example of work: Update and delete
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { update, remove } = useCollection('transactions'); await update({ _id: docId }, { $set: { category: 'Food' } }); await remove({ _id: docId });
is related to: usePublicCollection
is related to: useAgent
is related to: useDatasets
is related to: useQuery
is related to: Two-layer data model — shared vs per-user

useAgent
type: APIReference
description: Run AI agent queries with streaming, tool calls, interrupts, status updates, and automatic conversation persistence.
article section: ai
keywords: hook, ai, Flowstack SDK, useCollection, useAuth, useDatasets
is part of: Flowstack SDK
assembly version: 0.1.0
programming model: const { messages, isStreaming, isLoading, toolCalls, connectedDataSources, error, query, clearMessages, startNewSession, cancelQuery, interruptAgent, respondToInterrupt } = useAgent(template?, options?)
example of work: Persona-backed, multi-surface app
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: // Each surface gets its own brain + isolated conversation. const chat = useAgent('custom', { capabilities: ['data_access'], persona: 'assistant', sessionKey: 'chat' }); const worker = useAgent('custom', { capabilities: ['data_access'], persona: 'worker', sessionKey: 'tasks' });
example of work: Multi-turn chat with automatic memory
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: function AssistantChat() { const { query, messages, isStreaming } = useAgent(undefined, { persona: 'assistant' // agent registered via casino_create_agent }); // Turn 1: "summarize this dataset" // Turn 2: "now group it by region" ← agent remembers "this dataset" // Turn 3: "which region is the biggest?" ← agent knows the grouping from turn 2 return ( <ChatUI messages={messages} onSend={query} isStreaming={isStreaming} /> ); }
example of work: Persist a conversation across reloads (0.2.1+)
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const chat = useAgent('custom', { capabilities: ['data_access'], sessionKey: 'support-chat' }); // Reopening/reloading this surface resumes the same conversation; a different sessionKey is a // different conversation. Call chat.clearMessages() / startNewSession() to start fresh.
is related to: useCollection
is related to: useAuth
is related to: useDatasets

useAuth
type: APIReference
description: Read and mutate Casino-platform auth state (login, register, Google sign-in, logout, token refresh).
article section: auth
keywords: hook, auth, Flowstack SDK, BrokeredLoginButton, useFlowstackStatus, AuthGuard
is part of: Flowstack SDK
assembly version: 0.1.0
programming model: const { user, credentials, isAuthenticated, isLoading, error, login, register, googleSignIn, logout, refreshToken } = useAuth()
example of work: Built apps — read auth state instead
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { isAuthenticated, isInitialized, credentials } = useFlowstack();
is related to: BrokeredLoginButton
is related to: useFlowstackStatus
is related to: AuthGuard

useMessages
type: APIReference
description: Read and send private messages within one DM thread in a built app.
article section: built-apps
keywords: hook, built-apps, Flowstack SDK, useThreads, sendMessage, listMessages, DmMessage
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: const { messages, send, isLoading, error, refresh } = useMessages(withUserKey, options?)
example of work: Read and send
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { messages, send } = useMessages(counterpartUserKey, { refreshInterval: 4000 }); await send('hey there'); messages.map((m) => ( <Bubble key={m.message_id} mine={m.from === myKey}>{m.body}</Bubble> ));
is related to: useThreads
is related to: sendMessage
is related to: listMessages
is related to: DmMessage

useThreads
type: APIReference
description: List a built-app user's private message threads, with unread counts and consent control.
article section: built-apps
keywords: hook, built-apps, Flowstack SDK, useMessages, listThreads, openThread, DmThread
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: const { threads, isLoading, error, refresh, openThread } = useThreads(options?)
example of work: List threads with polling
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { threads, isLoading, openThread } = useThreads({ refreshInterval: 5000 }); threads.map((t) => ( <ThreadRow key={t.pair_key} counterpart={t.with_user_key} unread={t.unread_count} /> )); // Consent to open a new conversation const status = await openThread(otherUserKey); // 'pending' | 'open' | null
is related to: useMessages
is related to: listThreads
is related to: openThread
is related to: DmThread

sendMessage
type: APIReference
description: Client function: send a private message. 403 unless the thread is mutually open.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, useMessages, openThread, listMessages
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: sendMessage(credentials, toUserKey, body, config?): Promise<ApiResponse<{ message_id: string; created_at: string }>>
example of work: Send a message
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await sendMessage(credentials, toUserKey, 'hey there', { appScope }); if (!res.ok) console.error(res.error); // e.g. thread not open
is related to: useMessages
is related to: openThread
is related to: listMessages

listMessages
type: APIReference
description: Client function: list messages in the caller's thread with a counterpart. ACL'd server-side.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, useMessages, sendMessage, DmMessage
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: listMessages(credentials, withUserKey, options?, config?): Promise<ApiResponse<{ messages: DmMessage[]; count: number }>>
example of work: List messages
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await listMessages(credentials, counterpartKey, { limit: 50 }, { appScope }); if (res.ok) console.log(res.data.messages);
is related to: useMessages
is related to: sendMessage
is related to: DmMessage

DmMessage
type: APIReference
description: A single private message within a DM thread.
article section: built-apps
keywords: type, built-apps, Flowstack SDK, useMessages, listMessages, sendMessage, DmThread
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: interface DmMessage { message_id: string; from: string; to: string; body: string; created_at: string; read_at: string | null }
is related to: useMessages
is related to: listMessages
is related to: sendMessage
is related to: DmThread

useSites
type: APIReference
description: Manage published sites — list, create, stage files, publish to CDN, and delete.
article section: built-apps
keywords: hook, built-apps, Flowstack SDK
is part of: Flowstack SDK
programming model: const { sites, isLoading, error, createSite, addFile, publishSite, deleteSite, refreshSites } = useSites()
example of work: Hook surface
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { sites, // PublishedSiteInfo[] isLoading, // boolean error, // string | null createSite, // (params: CreateSiteParams) => Promise<PublishedSiteInfo | null> addFile, // (siteId, path, content) => Promise<boolean> publishSite, // (siteId) => Promise<PublishedSiteInfo | null> deleteSite, // (siteId) => Promise<boolean> refreshSites, // () => Promise<void> } = useSites();
example of work: Two publishing workflows
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: // Quick publish — pass files inline await createSite({ name: 'My Dashboard', siteType: 'on_demand', files: { 'index.html': ' ... ', 'styles.css': 'body { ... }' }, }); // Staged publish — add files incrementally, then publish const site = await createSite({ name: 'My App' }); await addFile(site.id, 'index.html', ' ... '); await addFile(site.id, 'src/App.tsx', 'export default function App() { ... }'); await publishSite(site.id);

listThreads
type: APIReference
description: Client function: list the caller's DM threads (counterpart key, last message, unread count).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, useThreads, listMessages, DmThread
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: listThreads(credentials, config?): Promise<ApiResponse<{ threads: DmThread[]; count: number }>>
example of work: List threads
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await listThreads(credentials, { appScope }); if (res.ok) console.log(res.data.threads);
is related to: useThreads
is related to: listMessages
is related to: DmThread

openThread
type: APIReference
description: Client function: record the caller's consent to open a DM thread with another user.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, useThreads, sendMessage, dmPairKey
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: openThread(credentials, withUserKey, config?): Promise<ApiResponse<{ pair_key: string; status: string }>>
example of work: Open a thread
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await openThread(credentials, otherUserKey, { appScope }); if (res.ok) console.log(res.data.status); // 'pending' until the other party also consents
is related to: useThreads
is related to: sendMessage
is related to: dmPairKey

DmThread
type: APIReference
description: A private message thread between the caller and one counterpart.
article section: built-apps
keywords: type, built-apps, Flowstack SDK, useThreads, listThreads, DmMessage, dmPairKey
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: interface DmThread { pair_key: string; with_user_key: string; status: 'pending' | 'open'; last_message: DmMessage | null; unread_count: number; updated_at: string | null }
is related to: useThreads
is related to: listThreads
is related to: DmMessage
is related to: dmPairKey

activateDomain
type: APIReference
description: Client function: activate a domain once its ACM cert is issued (CloudFront goes live ~5–15 min after).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, getDomainStatus, connectDomain
is part of: Flowstack SDK
assembly version: 0.2.8
programming model: activateDomain(credentials, siteId, domain, config?): Promise<ApiResponse<ActivateDomainResult>>
example of work: Activate
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await activateDomain(credentials, siteId, 'app.example.com', { appScope }); if (res.ok) console.log('live at', res.data.url);
is related to: getDomainStatus
is related to: connectDomain

getDomainStatus
type: APIReference
description: Client function: poll a custom domain's validation/activation status.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, connectDomain, activateDomain, CustomDomainRecord
is part of: Flowstack SDK
assembly version: 0.2.8
programming model: getDomainStatus(credentials, siteId, domain, config?): Promise<ApiResponse<DomainStatusResult>>
example of work: Poll until issued
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await getDomainStatus(credentials, siteId, 'app.example.com', { appScope }); if (res.ok && res.data.status === 'issued') { await activateDomain(credentials, siteId, 'app.example.com', { appScope }); }
is related to: connectDomain
is related to: activateDomain
is related to: CustomDomainRecord

connectDomain
type: APIReference
description: Client function: start connecting a custom domain — requests an ACM cert and returns the DNS records to add.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, getDomainStatus, activateDomain, listDomains, disconnectDomain, CustomDomainRecord
is part of: Flowstack SDK
assembly version: 0.2.8
programming model: connectDomain(credentials, siteId, domain, config?): Promise<ApiResponse<ConnectDomainResult>>
example of work: Connect a domain
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await connectDomain(credentials, siteId, 'app.example.com', { appScope }); if (res.ok) { for (const r of res.data.validation_records) console.log(`${r.type} ${r.name} -> ${r.value}`); console.log('routing:', res.data.routing_record); }
is related to: getDomainStatus
is related to: activateDomain
is related to: listDomains
is related to: disconnectDomain
is related to: CustomDomainRecord

clearStagedFiles
type: APIReference
description: Client function: clear all staged files for a site (the .staging marker is preserved).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, stageFiles, listStagedFiles
is part of: Flowstack SDK
assembly version: 0.2.7
programming model: clearStagedFiles(credentials, siteId, config?): Promise<ApiResponse<{ cleared: boolean; site_id: string; deleted_count: number }>>
example of work: Clear staged files
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: await clearStagedFiles(credentials, siteId, { appScope });
is related to: stageFiles
is related to: listStagedFiles

stageFiles
type: APIReference
description: Client function: stage multiple files in one call (batch form of addSiteFile).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, listStagedFiles, clearStagedFiles, getAppSource
is part of: Flowstack SDK
assembly version: 0.2.7
programming model: stageFiles(credentials, siteId, files, config?): Promise<ApiResponse<{ staged: boolean; site_id: string; staged_count: number; paths: string[]; total_bytes: number }>>
example of work: Stage two files
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await stageFiles(credentials, siteId, { 'index.html': ' hi ', 'app.js': 'console.log(1)', }, { appScope });
is related to: listStagedFiles
is related to: clearStagedFiles
is related to: getAppSource

listStagedFiles
type: APIReference
description: Client function: list the files currently staged for a site.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, stageFiles, clearStagedFiles
is part of: Flowstack SDK
assembly version: 0.2.7
programming model: listStagedFiles(credentials, siteId, config?): Promise<ApiResponse<StagedFilesList>>
example of work: List staged files
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await listStagedFiles(credentials, siteId, { appScope }); if (res.ok) console.log(res.data.count, 'staged');
is related to: stageFiles
is related to: clearStagedFiles

listDomains
type: APIReference
description: Client function: list the custom domains connected to a site and their status.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, connectDomain, getDomainStatus, CustomDomainRecord
is part of: Flowstack SDK
assembly version: 0.2.8
programming model: listDomains(credentials, siteId, config?): Promise<ApiResponse<{ site_id: string; domains: CustomDomainRecord[] }>>
example of work: List domains
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await listDomains(credentials, siteId, { appScope }); if (res.ok) res.data.domains.forEach(d => console.log(d.domain, d.status));
is related to: connectDomain
is related to: getDomainStatus
is related to: CustomDomainRecord

disconnectDomain
type: APIReference
description: Client function: disconnect a custom domain from a site.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, connectDomain, listDomains
is part of: Flowstack SDK
assembly version: 0.2.8
programming model: disconnectDomain(credentials, siteId, domain, config?): Promise<ApiResponse<{ success: boolean; domain: string; site_id: string; message: string }>>
example of work: Disconnect
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: await disconnectDomain(credentials, siteId, 'app.example.com', { appScope });
is related to: connectDomain
is related to: listDomains

CustomDomainRecord
type: APIReference
description: Type: a connected custom domain and its lifecycle status.
article section: built-apps
keywords: type, built-apps, Flowstack SDK, connectDomain, listDomains, getDomainStatus
is part of: Flowstack SDK
assembly version: 0.2.8
programming model: interface CustomDomainRecord { domain: string; site_id: string; status: 'validating' | 'issued' | 'activating' | 'live' | 'failed'; cert_arn?: string; connected_at?: string; activated_at?: string; last_check?: string; cert_status?: string }
is related to: connectDomain
is related to: listDomains
is related to: getDomainStatus

dmPairKey
type: APIReference
description: Pure helper: deterministic, order-independent thread key for a pair of user keys.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, openThread, useThreads, DmThread
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: dmPairKey(a: string, b: string): string
example of work: Derive a thread key
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: dmPairKey('userA', 'userB'); // 'userA::userB' dmPairKey('userB', 'userA'); // 'userA::userB' (same)
is related to: openThread
is related to: useThreads
is related to: DmThread

getAppSource
type: APIReference
description: Client function: fetch a version's source files as a { path: content } map (live version by default).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, stageFiles, useSiteVersions
is part of: Flowstack SDK
assembly version: 0.2.7
programming model: getAppSource(credentials, siteId, version?, config?): Promise<ApiResponse<AppSource>>
example of work: Read the live source
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await getAppSource(credentials, siteId, undefined, { appScope }); if (res.ok) for (const [p, content] of Object.entries(res.data.files)) console.log(p, content.length);
is related to: stageFiles
is related to: useSiteVersions

useSiteVersions
type: APIReference
description: Work with the version history of a published site.
article section: workspaces
keywords: hook, workspaces, Flowstack SDK, useSites
is part of: Flowstack SDK
is related to: useSites

getDataPlan
type: APIReference
description: Client function: get the saved mongoCollections schema (data plan) for a site.
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, setDataPlan
is part of: Flowstack SDK
assembly version: 0.2.7
programming model: getDataPlan(credentials, siteId, config?): Promise<ApiResponse<DataPlan>>
example of work: Read the data plan
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await getDataPlan(credentials, siteId, { appScope });
is related to: setDataPlan

setDataPlan
type: APIReference
description: Client function: merge collection schemas into the site's data plan (PUT-with-merge).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, getDataPlan
is part of: Flowstack SDK
assembly version: 0.2.7
programming model: setDataPlan(credentials, siteId, collections, config?): Promise<ApiResponse<{ site_id: string; saved: string[]; mongoCollections: Record<string, unknown> }>>
example of work: Merge a collection schema
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: await setDataPlan(credentials, siteId, { tasks: { fields: { title: 'string', done: 'boolean' } }, }, { appScope });
is related to: getDataPlan

markMessageRead
type: APIReference
description: Client function: mark a received DM as read (recipient only).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, useMessages, listMessages, DmMessage
is part of: Flowstack SDK
assembly version: 0.2.2
programming model: markMessageRead(credentials, messageId, config?): Promise<ApiResponse<{ message_id: string; read: boolean }>>
example of work: Mark read
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: await markMessageRead(credentials, msg.message_id, { appScope });
is related to: useMessages
is related to: listMessages
is related to: DmMessage

purchaseDomain
type: APIReference
description: Client function: buy a domain through Casino — returns a Stripe Checkout URL; registration + site auto-connect fire from the payment webhook (P0-163).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, searchDomains, PurchaseDomainRequest, RegistrantContact, listDomains, getDomainStatus
is part of: Flowstack SDK
assembly version: 0.3.1
programming model: purchaseDomain(credentials, request, config?): Promise<ApiResponse<{ domain: string; price_usd: number; session_url: string; session_id: string }>>
example of work: Buy a domain and auto-connect it to a site
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await purchaseDomain(credentials, { domain: 'thezengarden', tld: 'com', registrant: { first_name: 'Ada', last_name: 'Lovelace', email: 'ada@example.com', phone: '+12125551234', address_line1: '1 Main St', city: 'New York', state: 'NY', zip_code: '10001', country_code: 'US', }, auto_renew: true, whois_privacy: true, site_id: siteId, }); if (res.data?.session_url) window.location.href = res.data.session_url;
is related to: searchDomains
is related to: PurchaseDomainRequest
is related to: RegistrantContact
is related to: listDomains
is related to: getDomainStatus

searchDomains
type: APIReference
description: Client function: check domain availability + Casino retail pricing across TLDs (P0-163).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, purchaseDomain, DomainSearchResult, connectDomain, listDomains
is part of: Flowstack SDK
assembly version: 0.3.1
programming model: searchDomains(credentials, name, tlds?, config?): Promise<ApiResponse<{ results: DomainSearchResult[]; degraded?: boolean }>>
example of work: Check a name across TLDs
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await searchDomains(credentials, 'thezengarden', 'com,dev,app'); if (res.data?.degraded) { showError('Domain search is temporarily unavailable — try again shortly.'); } else { for (const r of res.data.results) { if (r.available) console.log(`${r.domain} — $${r.price_usd}/yr`); } }
is related to: purchaseDomain
is related to: DomainSearchResult
is related to: connectDomain
is related to: listDomains

PurchaseDomainRequest
type: APIReference
description: Request body for purchaseDomain: name + TLD + registrant contact + auto-renew/privacy/auto-connect options (P0-163).
article section: built-apps
keywords: type, built-apps, Flowstack SDK, purchaseDomain, RegistrantContact, DomainSearchResult, searchDomains
is part of: Flowstack SDK
assembly version: 0.3.1
programming model: interface PurchaseDomainRequest
is related to: purchaseDomain
is related to: RegistrantContact
is related to: DomainSearchResult
is related to: searchDomains

RegistrantContact
type: APIReference
description: WHOIS registrant contact for a domain purchase — registrar-validated formats (P0-163).
article section: built-apps
keywords: type, built-apps, Flowstack SDK, PurchaseDomainRequest, purchaseDomain, searchDomains
is part of: Flowstack SDK
assembly version: 0.3.1
programming model: interface RegistrantContact
is related to: PurchaseDomainRequest
is related to: purchaseDomain
is related to: searchDomains

renameSite
type: APIReference
description: Client function: rename a site (display name in the manifest + dashboard metadata).
article section: built-apps
keywords: utility, built-apps, Flowstack SDK, getAppSource, useSiteVersions
is part of: Flowstack SDK
assembly version: 0.2.7
programming model: renameSite(credentials, siteId, name, config?): Promise<ApiResponse<{ site_id: string; name: string }>>
example of work: Rename a site
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await renameSite(credentials, siteId, 'My CRM', { appScope }); if (!res.ok) console.error(res.error);
is related to: getAppSource
is related to: useSiteVersions

DomainSearchResult
type: APIReference
description: One TLD's availability + Casino retail price from searchDomains (P0-163).
article section: built-apps
keywords: type, built-apps, Flowstack SDK, searchDomains, purchaseDomain, PurchaseDomainRequest
is part of: Flowstack SDK
assembly version: 0.3.1
programming model: interface DomainSearchResult
is related to: searchDomains
is related to: purchaseDomain
is related to: PurchaseDomainRequest

useFlowstackStatus
type: APIReference
description: Monitor the backend connection status, latency, and connectivity with optional polling.
article section: utilities
keywords: hook, utilities, Flowstack SDK, useAuth
is part of: Flowstack SDK
programming model: const { status, isConnected, latency, error, checkConnection } = useFlowstackStatus(options)
example of work: Connection monitoring
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { status, // 'connected' | 'disconnected' | 'checking' isConnected, // boolean latency, // number | null (ms) error, // string | null checkConnection, // () => Promise<void> } = useFlowstackStatus({ pollInterval: 30000, autoPoll: true, });
is related to: useAuth

useAuthGuard
type: APIReference
description: Programmatic route protection that reports whether access is allowed and where to redirect.
article section: auth
keywords: hook, auth, Flowstack SDK, useAuth, AuthGuard
is part of: Flowstack SDK
programming model: const { isAllowed, isLoading, shouldRedirect, redirectTo } = useAuthGuard(options)
example of work: Protect a route
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { isAllowed, // boolean isLoading, // boolean shouldRedirect, // boolean redirectTo, // string | undefined } = useAuthGuard({ requireAuth: true, requireWorkspace: true, redirectTo: '/login', });
is related to: useAuth
is related to: AuthGuard

Agent-Driven Data Models — Reason → Write → Read
type: APIReference
description: The core pattern for using an agent as a worker: the app reads context and passes it in the prompt, the agent reasons and writes a structured document, and the app reads the result back via useCollection.
article section: data
keywords: guide, data, Flowstack SDK, useAgent, useCollection, two-layer-data-model
is part of: Flowstack SDK
assembly version: 0.2.1
example of work: 1. Read context in the app, PII-safe projection
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: // Read the shared pool the agent will reason over. const pool = useCollection<Record>('records', { layer: 'shared', limit: 200 }); // Read the current user's OWN row with a dedicated 1-doc query — do NOT find() it // inside the pool. The pool can settle a beat later, so `pool.documents.find(...)` // reads as "missing" on first paint even when the row exists (a real, hard-won bug). // A filtered limit:1 query resolves it independently of the pool load. const mine = useCollection<Record>('records', { layer: 'shared', filter: { owner_key: myKey }, limit: 1, refreshOnAgentComplete: true, }); const self = mine.documents[0] ?? null; const others = pool.documents.filter(r => r.owner_key !== myKey); // PII-safe projection before the agent ever sees a row. const toSafe = (r: Record) => ({ owner_key: r.owner_key, title: r.title, tags: r.tags, // NO email, NO phone });
example of work: 2. Deterministic prompt naming the exact document shape
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: function buildPrompt(self, others, nowIso: string) { return [ `TASK — produce a result for owner_key "${self.owner_key}".`, 'Use the data provided below; do NOT query the database — it is all here.', '', 'SUBJECT:', JSON.stringify(self, null, 2), `CONTEXT (${others.length}):`, JSON.stringify(others, null, 2), '', 'Steps:', '1. Reason over the inputs.', '2. WRITE exactly one document to the "results" collection with insert_documents.', ` Use this exact run_at (do NOT call a time tool): "${nowIso}". The document MUST be:`, ' { "owner_key": "...", "run_at": "...", "status": "fresh",', ' "items": [{ "ref", "score", "reasons": [] }] }', '3. ALWAYS write the doc (even if items is empty). Never include email/phone.', 'Then reply with one short sentence summarizing the result.', ].join('\n'); }
example of work: 3. One-shot query, read result back reactively
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const agent = useAgent('custom', { capabilities: ['data_access'], sessionKey: 'worker' }); // The result collection — reads back what the agent writes. const results = useCollection<ResultDoc>('results', { layer: 'user', // per-user results; no owner_key filter needed (partition is scoped) sort: { run_at: -1 }, limit: 5, refreshOnAgentComplete: true, // auto-refresh when the agent's insert_documents completes }); async function run() { await Promise.all([pool.refresh(), mine.refresh()]); if (!self) return; // the 1-doc query may settle after first paint — gate on it await agent.query(buildPrompt(toSafe(self), others.map(toSafe), new Date().toISOString())); // results.documents[0] now holds the agent-written result (auto-refreshed). Render it directly. } const latest = results.documents[0]; const items = latest?.items ?? [];
example of work: 4. Upsert from the agent — ensure the row exists before you update it
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: // When an agent ENRICHES a record over a conversation, update_documents alone // silently no-ops if the row doesn't exist yet — the user 'finishes' the chat but // has no saved record (a real, hard-won bug). Tell the agent to UPSERT: insert a // starter row first, then update it as it learns. function enrichPrompt(ownerKey: string) { return [ `ENRICH MODE. owner_key: "${ownerKey}".`, 'FIRST, query the "profiles" collection for this owner_key.', 'If there is NO doc, INSERT one now (insert_documents) as a starter row:', ` { "owner_key": "${ownerKey}", "fields": {}, "created_at": <ISO> }`, 'THEN, as you learn facts, UPDATE that doc (update_documents, filter by', 'owner_key) and set updated_at. Keep nuanced observations as append-only notes.', ].join('\n'); } // The app reflects the row passively — it never 'completes' on a chat marker. // With refreshOnAgentComplete, the indicator flips once the row lands. const mineP = useCollection<Profile>('profiles', { layer: 'shared', filter: { owner_key: myKey }, limit: 1, refreshOnAgentComplete: true, }); const ready = !!mineP.documents[0];
is related to: useAgent
is related to: useCollection
is related to: Two-layer data model — shared vs per-user

Two-layer data model — shared vs per-user
type: APIReference
description: How useCollection and the agent's data tools resolve a collection to one of two namespaces — a physically isolated per-user database or a single world-readable shared pool — via the layer option.
article section: data
keywords: guide, data, Flowstack SDK, useCollection, reason-write-read, useAgent
is part of: Flowstack SDK
example of work: File upload to MongoDB via useCollection
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { insert } = useCollection('transactions'); const handleCSVUpload = async (file: File) => { const text = await file.text(); const rows = Papa.parse(text, { header: true }).data; await insert(rows.map(row => ({ ...row, amount: Number(row.amount), imported_at: new Date().toISOString(), }))); // All useCollection('transactions') instances auto-refresh };
is related to: useCollection
is related to: Agent-Driven Data Models — Reason → Write → Read
is related to: useAgent

form-write-direct
type: APIReference
description: Save form submissions and simple CRUD deterministically — no LLM, no tokens, no streaming
article section: data
keywords: recipe, data, Flowstack SDK, per-user-store, shared-pool, reason-write-read, useToolInvocation, useCollection
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useState } from 'react'; import { useCollection } from '@flowstack/sdk'; export function ContactForm() { const [email, setEmail] = useState(''); const [msg, setMsg] = useState(''); const { insert } = useCollection('submissions', { layer: 'shared' }); return ( { e.preventDefault(); await insert({ email, msg, submitted_at: new Date().toISOString() }); setEmail(''); setMsg(''); }} > setEmail(e.target.value)} placeholder="Email" /> setMsg(e.target.value)} /> Send ); }
is related to: per-user-store
is related to: shared-pool
is related to: Agent-Driven Data Models — Reason → Write → Read
is related to: useToolInvocation
is related to: useCollection

per-user-store
type: APIReference
description: Give each signed-in user their own private data (notes, entries, history) isolated from every other user
article section: data
keywords: recipe, data, Flowstack SDK, shared-pool, form-write-direct, reason-write-read, useCollection
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useState } from 'react'; import { useCollection } from '@flowstack/sdk'; export function Notes() { const [draft, setDraft] = useState(''); const { documents: notes, insert, remove } = useCollection('notes', { layer: 'user', sort: { created_at: -1 }, }); return ( <> setDraft(e.target.value)} /> { await insert({ text: draft, created_at: new Date().toISOString() }); setDraft(''); }} > Add note {notes.map(n => ( {n.text} remove({ _id: n._id })}>× ))} </> ); }
is related to: shared-pool
is related to: form-write-direct
is related to: Agent-Driven Data Models — Reason → Write → Read
is related to: useCollection

shared-pool
type: APIReference
description: Share one pool of data across all users of the app (leaderboards, feeds, catalogs), readable even before sign-in
article section: data
keywords: recipe, data, Flowstack SDK, per-user-store, form-write-direct, usePublicCollection, useCollection
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useCollection, usePublicCollection } from '@flowstack/sdk'; export function Leaderboard({ signedIn }: { signedIn: boolean }) { // Public, pre-auth read: const { documents: publicRows } = usePublicCollection('scores', { sort: { points: -1 }, limit: 10, }); // Signed-in write path: const { insert } = useCollection('scores', { layer: 'shared' }); return ( <> {publicRows.map(r => {r.player}: {r.points} )} {signedIn && ( insert({ player: 'me', points: 1, at: new Date().toISOString() })}> Post score )} </> ); }
is related to: per-user-store
is related to: form-write-direct
is related to: usePublicCollection
is related to: useCollection

useToolInvocation
type: APIReference
description: Low-level hook for directly invoking an agent tool.
article section: ai
keywords: hook, ai, Flowstack SDK, useCollection, useAgent
is part of: Flowstack SDK
is related to: useCollection
is related to: useAgent

library-import-analyze
type: APIReference
description: Import a workspace library item (dataset, report, document, visualization) into the app's agent and analyze it
article section: data
keywords: recipe, data, Flowstack SDK, reason-write-read, casino_list_library, casino_import_from_library, casino_talk_to_agent, useCollection
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: // Build-time (MCP path — Claude driving the casino tools): // 1. casino_list_library({ item_type: "dataset" }) // 2. casino_import_from_library({ site_id, item_id }) // 3. casino_talk_to_agent({ // site_id, // agent_name: "analyst", // message: "Analyze the imported sales dataset; insert one doc per finding into " + // "findings: {title, detail, metric, created_at (ISO)}.", // file_refs: ["sales_2026.csv"], // }) // // App-side read (tsx): // const { documents } = useCollection('findings', { // sort: { created_at: -1 }, // refreshOnAgentComplete: true, // });
is related to: Agent-Driven Data Models — Reason → Write → Read
is related to: api
is related to: useCollection

scheduled-agent-report
type: APIReference
description: Run an agent prompt on a cron schedule and surface its output in the app (daily digests, weekly reports)
article section: data
keywords: recipe, data, Flowstack SDK, reason-write-read, useAutomations, useCollection, casino_create_automation
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useAutomations, useCollection } from '@flowstack/sdk'; export function DailyDigest() { const { automations, create, pause, resume } = useAutomations(); const digest = automations.find(a => a.name === 'daily-digest'); const { documents: reports } = useCollection('daily_reports', { sort: { run_at: -1 }, limit: 7, }); return ( <> {!digest && ( create({ name: 'daily-digest', prompt: 'Summarize yesterday\'s rows in the transactions collection and insert ' + 'one doc into daily_reports: {summary, total, run_at (ISO)}.', schedule: '0 8 * * *', output_config: { type: 'silent' }, }) } > Enable daily digest )} {digest && ( (digest.status === 'paused' ? resume(digest.id) : pause(digest.id))}> {digest.status === 'paused' ? 'Resume' : 'Pause'} )} {reports.map(r => {r.summary} )} </> ); }
is related to: Agent-Driven Data Models — Reason → Write → Read
is related to: useAutomations
is related to: useCollection
is related to: api

useAutomations
type: APIReference
description: Schedule agent prompts on a cron schedule (via AWS EventBridge) with silent, email, webhook, or file delivery.
article section: integrations
keywords: hook, integrations, Flowstack SDK, useIntegrations, useConnections, useAgent
is part of: Flowstack SDK
programming model: const { automations, isLoading, error, create, update, remove, pause, resume, runNow, getRuns, refresh } = useAutomations()
example of work: Schedule a daily digest and manage runs
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useAutomations } from 'flowstack-sdk'; const { automations, create, pause, resume, runNow, getRuns } = useAutomations(); // Daily sales digest — weekdays at 9 AM Eastern await create({ name: 'Daily sales digest', prompt: "Pull yesterday's orders from Shopify, summarize revenue by product and region, flag any anomalies.", schedule: '0 9 * * 1-5', timezone: 'America/New_York', target_agents: ['shopify_analyst'], // routes to a specific agent persona; omit for default output_config: { type: 'email', to: 'team@company.com', subject_template: 'Sales digest — {date}', }, }); // Run once right now (ignores schedule) await runNow(automationId); // Pause / resume await pause(automationId); await resume(automationId); // Get last 10 run results const runs = await getRuns(automationId, 10); // [{run_id, status, started_at, duration_ms, credits_used, output_summary, output_url}]
is related to: useIntegrations
is related to: useConnections
is related to: useAgent

usePublicCollection
type: APIReference
description: Anonymous, no-auth public collection reads and inserts for leaderboards, guestbooks, comment threads, and voting.
article section: data
keywords: hook, data, Flowstack SDK, useCollection, useAgent
is part of: Flowstack SDK
programming model: const { documents, count, total, isLoading, error, insert, refresh } = usePublicCollection<T>(name, options?)
example of work: Anonymous leaderboard
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { usePublicCollection } from 'flowstack-sdk'; const { documents, // T[] count, // number total, // number isLoading, // boolean error, // string | null insert, // (doc: Partial<T>) => Promise<{ inserted_id: string }> refresh, // () => Promise<void> } = usePublicCollection<HighScore>('high_scores', { filter: { album: 'yeezus' }, sort: { score: -1 }, limit: 25, }); await insert({ album: 'yeezus', name: 'KEON', score: 12500 });
example of work: Builder config required in app_config.json
  type: SoftwareSourceCode
  programming language: json
  code sample type: code snippet
  text: { "publicCollections": { "high_scores": { "schema": { "album": { "type": "string", "required": true, "maxLength": 32 }, "name": { "type": "string", "required": true, "maxLength": 24 }, "score": { "type": "number", "required": true, "min": 0 } }, "rateLimit": { "writesPerMinute": 5, "writesPerDay": 50 } } } }
is related to: useCollection
is related to: useAgent

useDatasets
type: APIReference
description: List, upload, download, and delete datasets, with reactive loading and error state.
article section: data
keywords: hook, data, Flowstack SDK, useCollection, useVisualizations, useReports, useDataSources, useQuery
is part of: Flowstack SDK
programming model: const { datasets, isLoading, error, uploadDataset, downloadDataset, deleteDataset, refreshDatasets } = useDatasets()
example of work: useDatasets example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { datasets, // DatasetInfo[] — { id, name, rows, columns, schema?, columnNames?, createdAt?, updatedAt? } isLoading, // boolean error, // string | null uploadDataset, // (file, name?) => Promise<DatasetInfo | null> downloadDataset, // (name) => Promise<Blob | null> deleteDataset, // (name) => Promise<boolean> refreshDatasets, // () => Promise<void> } = useDatasets();
is related to: useCollection
is related to: useVisualizations
is related to: useReports
is related to: useDataSources
is related to: useQuery

useQuery
type: APIReference
description: Run a single one-shot query from a natural-language prompt without streaming.
article section: data
keywords: hook, data, Flowstack SDK, useCollection, useDatasets, useDataSources
is part of: Flowstack SDK
programming model: const { executeQuery, result, isLoading, error } = useQuery()
example of work: useQuery example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { executeQuery, // (prompt: string) => Promise<QueryResult> result, // QueryResult | null isLoading, // boolean error, // string | null } = useQuery();
is related to: useCollection
is related to: useDatasets
is related to: useDataSources

useCollectionExplorer
type: APIReference
description: Browse, query, export, and delete a specific MongoDB collection.
article section: data
keywords: hook, data, Flowstack SDK, useCollection, useUserCollections, useDataOverview
is part of: Flowstack SDK
is related to: useCollection
is related to: useUserCollections
is related to: useDataOverview

useUserCollections
type: APIReference
description: List all MongoDB collections the user owns.
article section: data
keywords: hook, data, Flowstack SDK, useCollection, useCollectionExplorer, useDataOverview
is part of: Flowstack SDK
is related to: useCollection
is related to: useCollectionExplorer
is related to: useDataOverview

useDataOverview
type: APIReference
description: Get a unified summary of all user-owned data.
article section: data
keywords: hook, data, Flowstack SDK, useUserCollections, useCollectionExplorer, useDatasets
is part of: Flowstack SDK
is related to: useUserCollections
is related to: useCollectionExplorer
is related to: useDatasets

useVisualizations
type: APIReference
description: List generated visualizations with reactive loading and error state.
article section: data
keywords: hook, data, Flowstack SDK, useDatasets, useReports, useQuery
is part of: Flowstack SDK
programming model: const { visualizations, isLoading, error, refreshVisualizations } = useVisualizations()
example of work: useVisualizations example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { visualizations, // VisualizationData[] — { name, type, imageUrl, imageBase64, format, createdAt } isLoading, // boolean error, // string | null refreshVisualizations,// () => Promise<void> } = useVisualizations();
is related to: useDatasets
is related to: useReports
is related to: useQuery

useReports
type: APIReference
description: List generated reports with reactive loading and error state.
article section: data
keywords: hook, data, Flowstack SDK, useDatasets, useVisualizations, useQuery
is part of: Flowstack SDK
programming model: const { reports, isLoading, error, refreshReports } = useReports()
example of work: useReports example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { reports, // ReportInfo[] — { name, content, format, createdAt } isLoading, // boolean error, // string | null refreshReports, // () => Promise<void> } = useReports();
is related to: useDatasets
is related to: useVisualizations
is related to: useQuery

useDataSources
type: APIReference
description: Manage external data source connections — create, test, delete, and list.
article section: data
keywords: hook, data, Flowstack SDK, useDatasets, useQuery
is part of: Flowstack SDK
programming model: const { dataSources, isLoading, error, createDataSource, testConnection, deleteDataSource, refreshDataSources } = useDataSources()
example of work: useDataSources example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { dataSources, // DataSource[] isLoading, // boolean error, // string | null createDataSource, // (config) => Promise<DataSource | null> testConnection, // (sourceId) => Promise<boolean> deleteDataSource, // (sourceId) => Promise<boolean> refreshDataSources,// () => Promise<void> } = useDataSources();
is related to: useDatasets
is related to: useQuery

Agent Catalog
type: APIReference
description: There are no pre-built ecosystem agents — agents are per-app; you create them with casino_create_agent via the Casino MCP and target them by name.
article section: ai
keywords: guide, ai, Flowstack SDK, targeting-custom-agents, tool-categories, tool-access-control, useAgent, useAgents
is part of: Flowstack SDK
example of work: Creating an agent (MCP) — category grant
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: casino_create_agent( site_id="<your_site_id>", name="support_bot", system_prompt="You are a helpful support assistant...", capabilities=["data_access"] // scopes what tools this agent can use )
example of work: Creating an agent (MCP) — per-tool grant
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: casino_create_agent( site_id="<your_site_id>", name="readonly_bot", system_prompt="You are a read-only support assistant...", tools=["query_mongodb", "count_documents"] // only these 2 tools, no writes )
example of work: Targeting it from your app
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { query, messages } = useAgent(undefined, { persona: 'support_bot', capabilities: ['data_access'], });
is related to: Targeting Custom Agents (Built Apps)
is related to: Available Tool Categories
is related to: Tool-level Access Control (P0-117)
is related to: useAgent
is related to: useAgents

Targeting Custom Agents (Built Apps)
type: APIReference
description: Built apps target an agent they create via `casino_create_agent` by passing its registered name as `persona` — a target is required for app-scoped users or they get a 403.
article section: ai
keywords: guide, ai, Flowstack SDK, useAgent, useAgents, agent-catalog, tool-categories
is part of: Flowstack SDK
example of work: Create then target a custom agent
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: // 1. Create your agent via MCP first (once, at setup time): // casino_create_agent(site_id, "support_bot", "You are a helpful support assistant...", capabilities=["data_access"]) // OR for per-tool control: casino_create_agent(site_id, "support_bot", "...", tools=["query_mongodb", "count_documents"]) // 2. Target it from your built app: const { query, messages, isStreaming } = useAgent(undefined, { persona: 'support_bot', // must match the name you registered capabilities: ['data_access'], // advisory — the registered persona's grant is authoritative });
is related to: useAgent
is related to: useAgents
is related to: Agent Catalog
is related to: Available Tool Categories

Available Tool Categories
type: APIReference
description: The nine capability categories you declare on a registered agent (and, advisorily, on `useAgent`), each granting a group of related tools.
article section: ai
keywords: guide, ai, Flowstack SDK, targeting-custom-agents, tool-access-control, agent-catalog
is part of: Flowstack SDK
is related to: Targeting Custom Agents (Built Apps)
is related to: Tool-level Access Control (P0-117)
is related to: Agent Catalog

Tool-level Access Control (P0-117)
type: APIReference
description: Pass an explicit tools list to casino_create_agent for per-tool access control, which overrides category-level capabilities grants.
article section: ai
keywords: guide, ai, Flowstack SDK, tool-categories, targeting-custom-agents, agent-catalog
is part of: Flowstack SDK
example of work: Discover tools, then create a read-only bot
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: // Step 1 — discover available tool names: casino_list_tools() // → returns { "data": ["query_mongodb", "insert_documents", ...], "capabilities": [...], ... } // Step 2 — create a read-only support bot (no write access): casino_create_agent( site_id="<your_site_id>", name="support_bot", system_prompt="You are a helpful support assistant...", tools=["query_mongodb", "count_documents", "describe_collection"] ) // → capabilities auto-derived as ["data_access"], tools enforced at runtime
is related to: Available Tool Categories
is related to: Targeting Custom Agents (Built Apps)
is related to: Agent Catalog

useAgents
type: APIReference
description: Discover the agents available to the current site, including their name, description, tools, trigger phrases, and intended use.
article section: ai
keywords: hook, ai, Flowstack SDK, useAgent, targeting-custom-agents, agent-catalog
is part of: Flowstack SDK
programming model: const { agents, isLoading, refreshAgents } = useAgents()
example of work: useAgents example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { agents, isLoading, refreshAgents } = useAgents(); // agents: AgentInfo[] — each has name, description, tools, triggerPhrases, useFor
is related to: useAgent
is related to: Targeting Custom Agents (Built Apps)
is related to: Agent Catalog

Agent Templates & Factory
type: APIReference
description: Pre-configured agent templates (data-science, marketing, support) plus a dynamic Agent Factory that routes user intent to the best registered agent.
article section: ai
keywords: guide, ai, Flowstack SDK, useAgent, ChatInterface, agent-catalog
is part of: Flowstack SDK
example of work: Pre-configured Templates
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { dataScienceTemplate, marketingTemplate, supportTemplate, createCustomTemplate } from 'flowstack-sdk'; // Use with ChatInterface <ChatInterface template="data-science" /> <ChatInterface template="marketing" /> <ChatInterface template="support" /> // Custom template const custom = createCustomTemplate({ streaming: true, networkMode: 'PUBLIC', systemPrompt: 'You are a helpful assistant for ...', });
example of work: Agent Factory (Dynamic Routing)
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { AgentFactory, IntentAnalyzer, AgentRegistry, DEFAULT_PATTERNS } from 'flowstack-sdk'; // Register agents const registry = new AgentRegistry(); registry.register({ name: 'data-analyst', description: 'Analyzes datasets and creates visualizations', template: dataScienceTemplate, patterns: [/analyz/i, /chart/i, /data/i], }); // Analyze user intent and route to best agent const analyzer = new IntentAnalyzer({ registry }); const intent = analyzer.analyze('Show me a chart of Q4 revenue'); // → { category: 'data-analysis', confidence: 0.92, entities: ['Q4 revenue'] }
is related to: useAgent
is related to: ChatInterface
is related to: Agent Catalog

ChatInterface
type: APIReference
description: Embeddable chat interface bound to an agent template.
article section: components
keywords: component, components, Flowstack SDK, ChatPage, MessageList, MarkdownRenderer, useAgent
is part of: Flowstack SDK
example of work: Chat interface
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <ChatInterface template="data-science" height={500} placeholder="Ask about your data..." />
is related to: ChatPage
is related to: MessageList
is related to: MarkdownRenderer
is related to: useAgent

useConversations
type: APIReference
description: Fetch the user's past Casino builder conversations.
article section: ai
keywords: hook, ai, Flowstack SDK, useAgent, useDataOverview
is part of: Flowstack SDK
is related to: useAgent
is related to: useDataOverview

useIntentAgent
type: APIReference
description: Create and manage agents dynamically based on user intent.
article section: ai
keywords: hook, ai, Flowstack SDK, useAgent, useAgents
is part of: Flowstack SDK
is related to: useAgent
is related to: useAgents

useModels
type: APIReference
description: ML model management — list registered models with their framework, metrics, and creation metadata.
article section: ai
keywords: hook, ai, Flowstack SDK
is part of: Flowstack SDK
programming model: const { models, isLoading, error, refreshModels } = useModels()
example of work: useModels example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { models, // ModelInfo[] — { name, framework, metrics, createdAt } isLoading, // boolean error, // string | null refreshModels, // () => Promise<void> } = useModels();

useOllamaDetection
type: APIReference
description: Detect a local Ollama instance and list its available models.
article section: ai
keywords: hook, ai, Flowstack SDK, useProviderCredentials, useModels
is part of: Flowstack SDK
is related to: useProviderCredentials
is related to: useModels

useProviderCredentials
type: APIReference
description: Manage LLM provider credentials (BYOK and Ollama).
article section: ai
keywords: hook, ai, Flowstack SDK, useOllamaDetection, useModels
is part of: Flowstack SDK
is related to: useOllamaDetection
is related to: useModels

useUserManagement
type: APIReference
description: Admin hook to list, search, paginate, and mutate managed users plus view user stats and activity.
article section: workspaces
keywords: hook, workspaces, Flowstack SDK, useWorkspace
is part of: Flowstack SDK
programming model: const { users, stats, isLoading, error, canManageUsers, pagination, refreshUsers, getUser, updateUser, suspendUser, reactivateUser, deleteUser, getUserActivity, refreshStats, setPage, setSearch, setRoleFilter, setStatusFilter } = useUserManagement()
example of work: Admin user management
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { users, // ManagedUser[] stats, // UserStats | null — { totalUsers, activeUsers, newUsersThisMonth } isLoading, // boolean error, // string | null canManageUsers, // boolean pagination, // { page, limit, totalCount, hasMore } refreshUsers, // (params?) => Promise<void> getUser, // (userId) => Promise<ManagedUser | null> updateUser, // (userId, updates) => Promise<boolean> suspendUser, // (userId, reason?) => Promise<boolean> reactivateUser, // (userId) => Promise<boolean> deleteUser, // (userId) => Promise<boolean> getUserActivity, // (userId, limit?) => Promise<UserActivityLog[]> refreshStats, // () => Promise<void> setPage, // (page) => void setSearch, // (search) => void setRoleFilter, // (role) => void setStatusFilter, // (status) => void } = useUserManagement();
is related to: useWorkspace

useWorkspace
type: APIReference
description: List, create, and select workspaces for the current user.
article section: workspaces
keywords: hook, workspaces, Flowstack SDK, useUserManagement
is part of: Flowstack SDK
programming model: const { workspaces, selectedWorkspace, isLoading, error, createWorkspace, selectWorkspace, refreshWorkspaces } = useWorkspace()
example of work: Workspace management
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { workspaces, // WorkspaceInfo[] selectedWorkspace, // WorkspaceInfo | null isLoading, // boolean error, // string | null createWorkspace, // (name, description?) => Promise<WorkspaceInfo | null> selectWorkspace, // (workspace) => void refreshWorkspaces, // () => Promise<void> } = useWorkspace();
is related to: useUserManagement

AuthPage
type: APIReference
description: Complete pre-built auth page with login/register tabs and optional Google sign-in.
article section: components
keywords: component, components, Flowstack SDK, LoginForm, RegisterForm, AuthGuard
is part of: Flowstack SDK
example of work: Complete auth page with login/register tabs
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <AuthPage defaultTab="login" onSuccess={() => router.push('/dashboard')} showGoogle />
is related to: LoginForm
is related to: RegisterForm
is related to: AuthGuard

LoginForm
type: APIReference
description: Pre-built login form with success/error callbacks and an optional register link.
article section: components
keywords: component, components, Flowstack SDK, RegisterForm, AuthGuard, AuthPage
is part of: Flowstack SDK
example of work: Login form
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <LoginForm onSuccess={handleSuccess} onError={handleError} showRegisterLink />
is related to: RegisterForm
is related to: AuthGuard
is related to: AuthPage

RegisterForm
type: APIReference
description: Pre-built registration form with a success callback and an optional login link.
article section: components
keywords: component, components, Flowstack SDK, LoginForm, AuthGuard, AuthPage
is part of: Flowstack SDK
example of work: Register form
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <RegisterForm onSuccess={handleSuccess} showLoginLink />
is related to: LoginForm
is related to: AuthGuard
is related to: AuthPage

ChatPage
type: APIReference
description: Full pre-built chat interface page.
article section: components
keywords: component, components, Flowstack SDK, ChatInterface, MessageList, MarkdownRenderer
is part of: Flowstack SDK
example of work: Full chat interface
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <ChatPage title="AI Assistant" placeholder="Ask anything..." welcomeMessage={<Welcome />} />
is related to: ChatInterface
is related to: MessageList
is related to: MarkdownRenderer

MessageList
type: APIReference
description: Renders a list of chat messages, with optional streaming state.
article section: components
keywords: component, components, Flowstack SDK, ChatInterface, MarkdownRenderer, useAgent
is part of: Flowstack SDK
example of work: Message list
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <MessageList messages={messages} isStreaming={isStreaming} />
is related to: ChatInterface
is related to: MarkdownRenderer
is related to: useAgent

MarkdownRenderer
type: APIReference
description: Drop-in component for rendering agent responses with full GFM support and automatic mid-stream table repair.
article section: components
keywords: component, components, Flowstack SDK, useAgent, MessageList, ChatInterface
is part of: Flowstack SDK
example of work: Render streaming agent responses
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useAgent, MarkdownRenderer } from 'flowstack-sdk'; function Chat() { const { messages, isStreaming } = useAgent('data-science'); return ( {messages.map(msg => msg.role === 'assistant' ? ( <MarkdownRenderer key={msg.id} content={msg.content} isStreaming={isStreaming && msg === messages.at(-1)} /> ) : ( {msg.content} ) )} ); }
is related to: useAgent
is related to: MessageList
is related to: ChatInterface

CreateWorkspaceModal
type: APIReference
description: Modal dialog for creating a new workspace.
article section: components
keywords: component, components, Flowstack SDK, WorkspaceSelector
is part of: Flowstack SDK
example of work: Create workspace modal
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <CreateWorkspaceModal isOpen={open} onCreated={handleCreated} />
is related to: WorkspaceSelector

WorkspaceSelector
type: APIReference
description: Pre-built control for selecting the active workspace.
article section: components
keywords: component, components, Flowstack SDK, CreateWorkspaceModal
is part of: Flowstack SDK
example of work: Workspace selector
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <WorkspaceSelector onSelect={handleSelect} />
is related to: CreateWorkspaceModal

DashboardLayout
type: APIReference
description: Pre-built dashboard layout with a sidebar, header, and content area.
article section: components
keywords: component, components, Flowstack SDK, AuthPage, ChatPage
is part of: Flowstack SDK
example of work: Dashboard layout with sidebar
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <DashboardLayout sidebar={<Sidebar />} header={ }> <Content /> </DashboardLayout>
is related to: AuthPage
is related to: ChatPage

DatasetUploader
type: APIReference
description: File-upload component for ingesting datasets such as CSV, XLSX, and Parquet files.
article section: components
keywords: component, components, Flowstack SDK, useDatasets
is part of: Flowstack SDK
example of work: Dataset uploader
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <DatasetUploader onUpload={handleUpload} accept=".csv,.xlsx,.parquet" />
is related to: useDatasets

Wallet Module
type: APIReference
description: Separate `flowstack-sdk/wallet` entry point for the two token systems (AGENT build credits, INFER query credits): reading balances, accepting payments, and accessing wallet addresses.
article section: wallet
keywords: guide, wallet, Flowstack SDK, useWalletAuth, useInferBalance, useAgentBalance, useDeposit, useBuyInfer, BrokeredLoginButton
is part of: Flowstack SDK
example of work: Required peer dependencies
  type: SoftwareSourceCode
  programming language: json
  code sample type: code snippet
  text: { "dependencies": { "@privy-io/react-auth": ">=2.0.0", "wagmi": ">=2.0.0", "viem": ">=2.0.0", "@tanstack/react-query": ">=5.0.0" } }
is related to: useWalletAuth
is related to: useInferBalance
is related to: useAgentBalance
is related to: useDeposit
is related to: useBuyInfer
is related to: BrokeredLoginButton

useWalletAuth
type: APIReference
description: Read wallet connection state and trigger Privy/SIWE login or logout from the `flowstack-sdk/wallet` entry point.
article section: wallet
keywords: hook, wallet, Flowstack SDK, useInferBalance, useAgentBalance, LoginButton, BrokeredLoginButton
is part of: Flowstack SDK
programming model: const { isConnected, isLoading, address, isEmbeddedWallet, authMethod, error, login, logout } = useWalletAuth()
is related to: useInferBalance
is related to: useAgentBalance
is related to: LoginButton
is related to: BrokeredLoginButton

useInferBalance
type: APIReference
description: Read the connected wallet's INFER token balance, including available balance and query credits.
article section: wallet
keywords: hook, wallet, Flowstack SDK, useAgentBalance, useDeposit, useBuyInfer, InferBalanceBadge
is part of: Flowstack SDK
programming model: const { data, isLoading, error, refetch } = useInferBalance()
is related to: useAgentBalance
is related to: useDeposit
is related to: useBuyInfer
is related to: InferBalanceBadge

useAgentBalance
type: APIReference
description: Poll the connected wallet's AGENT token balance so built apps can check whether the end-user can afford an operation.
article section: wallet
keywords: hook, wallet, Flowstack SDK, useInferBalance, NeedsAgent, AgentBalanceBadge
is part of: Flowstack SDK
programming model: const { data, isLoading, error, refetch } = useAgentBalance()
example of work: Reading available vs total AGENT
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const { data } = useAgentBalance(); // data.available — spendable AGENT (balance minus active holds) // data.balance — total AGENT in wallet
is related to: useInferBalance
is related to: NeedsAgent
is related to: AgentBalanceBadge

useDeposit
type: APIReference
description: Deposit INFER tokens from the connected wallet and track the resulting transaction hash.
article section: wallet
keywords: hook, wallet, Flowstack SDK, useInferBalance, useBuyInfer
is part of: Flowstack SDK
programming model: const { deposit, isDepositing, txHash, error } = useDeposit()
is related to: useInferBalance
is related to: useBuyInfer

useBuyInfer
type: APIReference
description: Open the fiat on-ramp widget to buy INFER tokens and track purchase status.
article section: wallet
keywords: hook, wallet, Flowstack SDK, useDeposit, useInferBalance, BuyInferModal
is part of: Flowstack SDK
programming model: const { buy, isBuying, status, error } = useBuyInfer()
is related to: useDeposit
is related to: useInferBalance
is related to: BuyInferModal

paywall-app
type: APIReference
description: Charge users of the app for access (unlock fee or metered queries) using the platform paywall
article section: wallet
keywords: recipe, wallet, Flowstack SDK, call-stripe-api, casino_set_monetization, AppPaywall, useAppAccess
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { AppPaywall } from '@flowstack/sdk/paywall'; export default function App() { return ( <AppPaywall siteId={import.meta.env.VITE_APP_SCOPE}> <YourAppContent /> </AppPaywall> ); }
is related to: call-stripe-api
is related to: api
is related to: AppPaywall
is related to: useAppAccess

call-stripe-api
type: APIReference
description: Operate on the OWNER's Stripe account (revenue dashboards, customer lookups, invoice ops) from a built app
article section: integrations
keywords: recipe, integrations, Flowstack SDK, paywall-app, call-http-integration, register-custom-api, useAgent, useCollection
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useAgent, useCollection } from '@flowstack/sdk'; export function RevenuePanel() { const { query, isStreaming } = useAgent(undefined, { capabilities: ['external_integration', 'data_access'], }); const { documents: events } = useCollection('payment_events', { layer: 'shared', sort: { created_at: -1 }, limit: 100, refreshOnAgentComplete: true, }); const totalCents = events.reduce((s, e) => s + (e.amount_cents ?? 0), 0); return ( <> query( 'Call the stripe integration: list the latest charges and upsert them into ' + 'payment_events (dedupe on event_id), matching its doc schema. No card data.' ) } > Refresh revenue ${(totalCents / 100).toFixed(2)} </> ); }
is related to: paywall-app
is related to: call-http-integration
is related to: register-custom-api
is related to: useAgent
is related to: useCollection

AppPaywall
type: APIReference
description: Access gate for monetized built apps: renders children when the end-user has access, otherwise shows a paywall overlay with the unlock CTA. The default way to charge users of an app.
article section: wallet
keywords: component, wallet, Flowstack SDK, useAppAccess, setMonetization, getMonetization, PaymentRequired, AppSubscriptionStatus
is part of: Flowstack SDK
assembly version: 0.2.4
programming model: <AppPaywall siteId={config.appScope} builderTenantId?={...} onBlocked?={(reason) => ...}>{children}</AppPaywall>
example of work: Wrap the app
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { AppPaywall } from 'flowstack-sdk/paywall'; export default function App() { return ( <AppPaywall siteId={config.appScope}> <YourAppContent /> </AppPaywall> ); }
is related to: useAppAccess
is related to: setMonetization
is related to: getMonetization
is related to: PaymentRequired
is related to: AppSubscriptionStatus

useAppAccess
type: APIReference
description: Check whether the authenticated end-user has access to a monetized built app, and open Stripe Checkout to unlock it. Use directly only for custom gate UI — `AppPaywall` wraps this with a default overlay.
article section: wallet
keywords: hook, wallet, Flowstack SDK, AppPaywall, setMonetization, getMonetization, PaymentRequired, AppSubscriptionStatus, subscribeToApp, cancelAppSubscription
is part of: Flowstack SDK
assembly version: 0.2.4
programming model: const { hasAccess, queriesUsed, queriesRemaining, paymentMode, unlockPriceCents, unlockPriceLabel, isLoading, error, checkout, refetch } = useAppAccess(siteId, opts?)
example of work: Custom gate UI
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useAppAccess } from 'flowstack-sdk/paywall'; function Gate({ children }: { children: React.ReactNode }) { const { hasAccess, queriesRemaining, unlockPriceLabel, isLoading, checkout } = useAppAccess(config.appScope); if (isLoading) return Checking access… ; if (hasAccess) return <>{children}</>; return ( {queriesRemaining === 0 ? 'Free queries used up.' : 'This app is premium.'} checkout()}>Unlock for {unlockPriceLabel} ); }
is related to: AppPaywall
is related to: setMonetization
is related to: getMonetization
is related to: PaymentRequired
is related to: AppSubscriptionStatus
is related to: subscribeToApp
is related to: cancelAppSubscription

NeedsAgent
type: APIReference
description: Gate a feature behind a minimum AGENT balance, showing a deep-linked "Get AGENT →" CTA when the user has insufficient funds.
article section: wallet
keywords: component, wallet, Flowstack SDK, useAgentBalance, PaymentRequired, BuyInferModal
is part of: Flowstack SDK
programming model: <NeedsAgent amountNeeded={2} onProceed={fn} returnUrl={url}>{children}</NeedsAgent>
example of work: Gate a feature behind 2 AGENT
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <NeedsAgent amountNeeded={2} onProceed={generateAlbumArt} returnUrl={window.location.href} > Generate a new design — costs 2 AGENT </NeedsAgent>
is related to: useAgentBalance
is related to: PaymentRequired
is related to: BuyInferModal

AgentBalanceBadge
type: APIReference
description: Display badge showing the connected wallet's AGENT token balance.
article section: wallet
keywords: component, wallet, Flowstack SDK, useAgentBalance, InferBalanceBadge
is part of: Flowstack SDK
programming model: <AgentBalanceBadge />
example of work: Display AGENT balance
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <AgentBalanceBadge />
is related to: useAgentBalance
is related to: InferBalanceBadge

setMonetization
type: APIReference
description: Client function: set a site's monetization (paywall) configuration.
article section: wallet
keywords: utility, wallet, Flowstack SDK, getMonetization, Monetization, getBuilderEarnings, getConnectStatus, MonetizationSubscriptionConfig
is part of: Flowstack SDK
assembly version: 0.2.6
programming model: setMonetization(credentials, siteId, monetization, config?): Promise<ApiResponse<{ site_id: string; monetization: Monetization; warnings?: string[] }>>
example of work: Enable an AGENT-token paywall
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: await setMonetization(credentials, siteId, { enabled: true, payment_mode: 'agent', }, { appScope });
is related to: getMonetization
is related to: Monetization
is related to: getBuilderEarnings
is related to: getConnectStatus
is related to: MonetizationSubscriptionConfig

getMonetization
type: APIReference
description: Client function: read a site's monetization (paywall) configuration.
article section: wallet
keywords: utility, wallet, Flowstack SDK, setMonetization, Monetization
is part of: Flowstack SDK
assembly version: 0.2.6
programming model: getMonetization(credentials, siteId, config?): Promise<ApiResponse<{ site_id: string; monetization: Monetization }>>
example of work: Read monetization
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await getMonetization(credentials, siteId, { appScope }); if (res.ok) console.log(res.data.monetization.enabled);
is related to: setMonetization
is related to: Monetization

PaymentRequired
type: APIReference
description: Gate content behind payment, rendering children only once the requirement is met.
article section: wallet
keywords: component, wallet, Flowstack SDK, NeedsAgent, BuyInferModal
is part of: Flowstack SDK
programming model: <PaymentRequired>{children}</PaymentRequired>
example of work: Gate content behind payment
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <PaymentRequired> <PaidContent /> </PaymentRequired>
is related to: NeedsAgent
is related to: BuyInferModal

AppSubscriptionStatus
type: APIReference
description: The end-user's subscription state for one app: status and billing period — status-only since 0.3.3/P0-167 (P0-162).
article section: wallet
keywords: type, wallet, Flowstack SDK, useAppAccess, AppPaywall, subscribeToApp, cancelAppSubscription, MonetizationSubscriptionConfig
is part of: Flowstack SDK
assembly version: 0.3.0
programming model: interface AppSubscriptionStatus
is related to: useAppAccess
is related to: AppPaywall
is related to: subscribeToApp
is related to: cancelAppSubscription
is related to: MonetizationSubscriptionConfig

subscribeToApp
type: APIReference
description: Client function: open Stripe Checkout for an app's monthly subscription plan (P0-162).
article section: wallet
keywords: utility, wallet, Flowstack SDK, cancelAppSubscription, useAppAccess, AppSubscriptionStatus, MonetizationSubscriptionConfig
is part of: Flowstack SDK
assembly version: 0.3.0
programming model: subscribeToApp(credentials, siteId, urls, config?): Promise<ApiResponse<{ url: string; site_id: string }>>
example of work: Subscribe from a non-React context
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await subscribeToApp(credentials, siteId, { success_url: window.location.href, cancel_url: window.location.href, }, { appScope: siteId }); if (res.data?.url) window.location.href = res.data.url;
is related to: cancelAppSubscription
is related to: useAppAccess
is related to: AppSubscriptionStatus
is related to: MonetizationSubscriptionConfig

cancelAppSubscription
type: APIReference
description: Client function: cancel an app subscription at period end (P0-162).
article section: wallet
keywords: utility, wallet, Flowstack SDK, subscribeToApp, useAppAccess, AppSubscriptionStatus
is part of: Flowstack SDK
assembly version: 0.3.0
programming model: cancelAppSubscription(credentials, siteId, config?): Promise<ApiResponse<{ status: string; cancel_at_period_end: boolean; current_period_end: string | null }>>
example of work: Cancel at period end
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: await cancelAppSubscription(credentials, siteId, { appScope: siteId });
is related to: subscribeToApp
is related to: useAppAccess
is related to: AppSubscriptionStatus

BuyInferModal
type: APIReference
description: Modal for buying INFER tokens.
article section: wallet
keywords: component, wallet, Flowstack SDK, useBuyInfer, PaymentRequired, NeedsAgent
is part of: Flowstack SDK
programming model: <BuyInferModal />
example of work: Buy INFER tokens modal
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <BuyInferModal />
is related to: useBuyInfer
is related to: PaymentRequired
is related to: NeedsAgent

InferBalanceBadge
type: APIReference
description: Display badge showing the connected wallet's INFER token balance.
article section: wallet
keywords: component, wallet, Flowstack SDK, useInferBalance, AgentBalanceBadge
is part of: Flowstack SDK
programming model: <InferBalanceBadge />
example of work: Display INFER balance
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <InferBalanceBadge />
is related to: useInferBalance
is related to: AgentBalanceBadge

LoginButton
type: APIReference
description: Privy/SIWE login button for the Casino platform only — built apps use `BrokeredLoginButton` instead.
article section: wallet
keywords: component, wallet, Flowstack SDK, useWalletAuth, BrokeredLoginButton
is part of: Flowstack SDK
programming model: <LoginButton />
example of work: Casino platform login
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: <LoginButton />
is related to: useWalletAuth
is related to: BrokeredLoginButton

getBuilderEarnings
type: APIReference
description: Client function: aggregate + per-app builder earnings across both rails (Stripe cents + on-chain AGENT).
article section: wallet
keywords: utility, wallet, Flowstack SDK, requestBuilderPayout, getConnectStatus, BuilderEarnings, getMonetization
is part of: Flowstack SDK
assembly version: 0.2.9
programming model: getBuilderEarnings(credentials, config?): Promise<ApiResponse<BuilderEarnings>>
example of work: Show available payout
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await getBuilderEarnings(credentials); if (res.ok) { const { available_cents, rails } = res.data; console.log(`Fiat available: $${(available_cents / 100).toFixed(2)}`); console.log(`AGENT accrued: ${rails.agent.accrued_agent}`); // human string — NOT wei }
is related to: requestBuilderPayout
is related to: getConnectStatus
is related to: BuilderEarnings
is related to: getMonetization

requestBuilderPayout
type: APIReference
description: Client function: withdraw the builder's available fiat balance to their connected Stripe account.
article section: wallet
keywords: utility, wallet, Flowstack SDK, getBuilderEarnings, getConnectStatus, startConnectOnboarding
is part of: Flowstack SDK
assembly version: 0.2.9
programming model: requestBuilderPayout(credentials, config?): Promise<ApiResponse<{ paid_cents: number; stripe_transfer_id: string; payout_id: string }>>
example of work: Withdraw
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await requestBuilderPayout(credentials); if (res.ok) console.log(`Paid $${(res.data.paid_cents / 100).toFixed(2)}`); else console.error(res.error); // e.g. below minimum, payouts not enabled
is related to: getBuilderEarnings
is related to: getConnectStatus
is related to: startConnectOnboarding

getConnectStatus
type: APIReference
description: Client function: live Stripe Connect account status for the builder (refreshes cached flags).
article section: wallet
keywords: utility, wallet, Flowstack SDK, startConnectOnboarding, requestBuilderPayout, ConnectStatus
is part of: Flowstack SDK
assembly version: 0.2.9
programming model: getConnectStatus(credentials, config?): Promise<ApiResponse<ConnectStatus>>
example of work: Gate payout UI
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await getConnectStatus(credentials); const canPayout = res.ok && res.data.payouts_enabled;
is related to: startConnectOnboarding
is related to: requestBuilderPayout
is related to: ConnectStatus

BuilderEarnings
type: APIReference
description: Type: the builder's full earnings picture — both rails, self-query summary, per-app breakdown.
article section: wallet
keywords: type, wallet, Flowstack SDK, getBuilderEarnings, requestBuilderPayout, Monetization
is part of: Flowstack SDK
assembly version: 0.2.9
programming model: interface BuilderEarnings { earned_cents: number; paid_cents: number; available_cents: number; min_payout_cents: number; currency: string; builder_user_id: string; as_of: string; rails: { stripe: StripeRailEarnings; agent: AgentRailEarnings }; self_query: SelfQuerySummary; compute?: ComputeSpendSummary; apps: AppEarnings[] }
is related to: getBuilderEarnings
is related to: requestBuilderPayout
is related to: Monetization

startConnectOnboarding
type: APIReference
description: Client function: create (or reuse) the builder's Stripe Connect Express account and get an onboarding link.
article section: wallet
keywords: utility, wallet, Flowstack SDK, getConnectStatus, requestBuilderPayout
is part of: Flowstack SDK
assembly version: 0.2.9
programming model: startConnectOnboarding(credentials, urls, config?): Promise<ApiResponse<{ url: string; stripe_account_id: string }>>
example of work: Kick off onboarding
  type: SoftwareSourceCode
  programming language: ts
  code sample type: code snippet
  text: const res = await startConnectOnboarding(credentials, { return_url: `${location.origin}/earnings?onboarded=1`, refresh_url: `${location.origin}/earnings?retry=1`, }); if (res.ok) window.location.href = res.data.url;
is related to: getConnectStatus
is related to: requestBuilderPayout

ConnectStatus
type: APIReference
description: Type: the builder's Stripe Connect account state.
article section: wallet
keywords: type, wallet, Flowstack SDK, getConnectStatus, startConnectOnboarding
is part of: Flowstack SDK
assembly version: 0.2.9
programming model: interface ConnectStatus { connected: boolean; stripe_account_id?: string; payouts_enabled: boolean; details_submitted?: boolean }
is related to: getConnectStatus
is related to: startConnectOnboarding

Monetization
type: APIReference
description: Type: a built app's monetization (paywall) config — Stripe and/or AGENT-token payment.
article section: wallet
keywords: type, wallet, Flowstack SDK, getMonetization, setMonetization, MonetizationSubscriptionConfig
is part of: Flowstack SDK
assembly version: 0.2.6
programming model: interface Monetization { enabled?: boolean; payment_mode?: 'stripe' | 'agent' | 'both'; stripe?: MonetizationStripeConfig; agent?: MonetizationAgentConfig; revenue_share_bps?: number }
is related to: getMonetization
is related to: setMonetization
is related to: MonetizationSubscriptionConfig

MonetizationSubscriptionConfig
type: APIReference
description: Monthly subscription plan config: $X/month for full access on the builder's Stripe Connect rails — pure access revenue since 0.3.3/P0-167 (P0-162).
article section: wallet
keywords: type, wallet, Flowstack SDK, Monetization, setMonetization, AppSubscriptionStatus, subscribeToApp, getConnectStatus
is part of: Flowstack SDK
assembly version: 0.3.0
programming model: interface MonetizationSubscriptionConfig
is related to: Monetization
is related to: setMonetization
is related to: AppSubscriptionStatus
is related to: subscribeToApp
is related to: getConnectStatus

call-http-integration
type: APIReference
description: Use a registered HTTP API integration (notion, slack, linear, or owner-registered) from a built app via the agent
article section: integrations
keywords: recipe, integrations, Flowstack SDK, call-stripe-api, register-custom-api, connect-oauth-service, useAgent, useCollection
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useAgent, useCollection } from '@flowstack/sdk'; export function IssueBoard() { const { query, isStreaming } = useAgent(undefined, { capabilities: ['external_integration', 'data_access'], }); const { documents: issues } = useCollection('linear_issues', { layer: 'shared', sort: { updated_at: -1 }, refreshOnAgentComplete: true, }); return ( <> query( 'Call the linear integration: fetch open issues and upsert them into ' + 'linear_issues (dedupe on issue_id), matching its doc schema.' ) } > Sync issues {issues.map(i => {i.identifier}: {i.title} )} </> ); }
is related to: call-stripe-api
is related to: register-custom-api
is related to: connect-oauth-service
is related to: useAgent
is related to: useCollection

register-custom-api
type: APIReference
description: Let the app OWNER register any HTTPS REST API as an integration the agent can call as a tool
article section: integrations
keywords: recipe, integrations, Flowstack SDK, call-http-integration, call-stripe-api, connect-oauth-service, useIntegrations, useAgent
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useIntegrations } from '@flowstack/sdk'; export function RegisterShopify() { const { integrations, create, isLoading } = useIntegrations(); if (integrations.some(i => i.name === 'shopify')) return Shopify registered. ; return ( create({ name: 'shopify', description: 'Shopify Admin API for order management and reporting', base_url: 'https://my-store.myshopify.com/admin/api/2024-01', auth_type: 'bearer', auth_config: { token: process.env.NEVER_HARDCODE_ME! }, endpoints: [ { name: 'list_orders', method: 'GET', path: '/orders.json' }, { name: 'get_order', method: 'GET', path: '/orders/{id}.json' }, ], }) } > Register Shopify ); }
is related to: call-http-integration
is related to: call-stripe-api
is related to: connect-oauth-service
is related to: useIntegrations
is related to: useAgent

connect-oauth-service
type: APIReference
description: Let each user connect an OAuth service (github, reddit, twitter, strava, google) and work with their data in the app
article section: integrations
keywords: recipe, integrations, Flowstack SDK, connect-strava, connect-google-services, useConnections, useAgent, useCollection
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useConnections, useAgent, useCollection } from '@flowstack/sdk'; export function GithubPanel() { const { connections, connect } = useConnections(); const github = connections.find(c => c.provider === 'github'); const { query } = useAgent(undefined, { capabilities: ['external_integration', 'data_access'], }); const { documents: repos } = useCollection('github_repos', { layer: 'user', sort: { updated_at: -1 }, refreshOnAgentComplete: true, }); if (!github?.connected) { return connect('github')}>Connect GitHub ; } return ( <> query('Sync my repos into github_repos (upsert on repo_id).')}> Sync repos {repos.map(r => {r.full_name} ★{r.stars} )} </> ); }
is related to: connect-strava
is related to: connect-google-services
is related to: useConnections
is related to: useAgent
is related to: useCollection

connect-google-services
type: APIReference
description: Let each user connect Google and use the sub-services their scopes actually grant (analytics, ads, drive, youtube)
article section: integrations
keywords: recipe, integrations, Flowstack SDK, connect-strava, connect-oauth-service, useConnections, useAgent, useCollection
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useConnections, useAgent, useCollection } from '@flowstack/sdk'; export function DrivePanel() { const { connections, connect } = useConnections(); const google = connections.find(c => c.provider === 'google'); const hasDrive = google?.connected && google.services?.includes('drive'); const { query } = useAgent(undefined, { capabilities: ['external_integration', 'data_access'], }); const { documents: files } = useCollection('drive_files', { layer: 'user', sort: { modified_at: -1 }, refreshOnAgentComplete: true, }); if (!hasDrive) { return connect('google', ['drive'])}>Connect Google Drive ; } return ( <> query('Sync my recent Drive files into drive_files (upsert on file_id).')}> Sync Drive {files.map(f => {f.name} )} </> ); }
is related to: connect-strava
is related to: connect-oauth-service
is related to: useConnections
is related to: useAgent
is related to: useCollection

connect-strava
type: APIReference
description: Let each user connect their Strava account and work with their activities in the app
article section: integrations
keywords: recipe, integrations, Flowstack SDK, reason-write-read, connect-oauth-service, useConnections, useAgent, useCollection
is part of: Flowstack SDK
assembly version: 0.2.8
example of work: End-to-end example
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useConnections, useAgent, useCollection } from '@flowstack/sdk'; export function StravaPanel() { const { connections, connect, isLoading } = useConnections(); const strava = connections.find(c => c.provider === 'strava'); const { query, isStreaming } = useAgent(undefined, { capabilities: ['external_integration', 'data_access'], }); const { documents: activities } = useCollection('strava_activities', { layer: 'user', sort: { start_date: -1 }, limit: 50, refreshOnAgentComplete: true, }); if (isLoading) return Loading… ; if (!strava?.connected) { return connect('strava')}>Connect Strava ; } return ( <> query( 'Fetch my 30 most recent Strava activities and upsert them into the ' + 'strava_activities collection (dedupe on activity_id), matching its doc schema.' ) } > Sync activities {activities.map(a => ( {a.name} — {(a.distance_m / 1000).toFixed(1)} km ))} </> ); }
is related to: Agent-Driven Data Models — Reason → Write → Read
is related to: connect-oauth-service
is related to: useConnections
is related to: useAgent
is related to: useCollection

useConnections
type: APIReference
description: Manage a user's external service connections (Google, Reddit, Strava, Twitter/X) so the AI agent can access their data.
article section: integrations
keywords: hook, integrations, Flowstack SDK, useIntegrations, useDataSources, useAgent
is part of: Flowstack SDK
programming model: const { connections, connect, disconnect, isLoading } = useConnections()
example of work: Check status and connect/disconnect
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useConnections } from 'flowstack-sdk'; const { connections, connect, disconnect, isLoading } = useConnections(); // Check status connections.google.connected // true | false connections.google.analytics // true | false (specific service) connections.google.email // "user@gmail.com" if connected connections.reddit.connected // true | false connections.strava.connected // true | false connections.twitter.connected // true | false // Connect — opens OAuth popup connect('google', ['analytics', 'drive']); // specific Google services connect('google', ['all']); // all Google services connect('reddit'); // Reddit connect('strava'); // Strava connect('twitter'); // Twitter/X // Disconnect disconnect('google'); disconnect('reddit');
example of work: Settings page pattern
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: function SettingsPage() { const { connections, connect, disconnect } = useConnections(); const services = [ { key: 'google', label: 'Google', sublabel: 'Analytics, Ads, Drive, YouTube', services: ['all'] as const }, { key: 'reddit', label: 'Reddit', sublabel: 'Feed access' }, { key: 'strava', label: 'Strava', sublabel: 'Activity data' }, { key: 'twitter', label: 'Twitter / X', sublabel: 'Timeline and bookmarks' }, ]; return ( Connected Services Connect your accounts so the AI assistant can access your data. {services.map(({ key, label, sublabel, services: svc }) => { const status = connections[key as keyof typeof connections]; return ( {label} {sublabel} {status.connected ? disconnect(key as any)}>Disconnect : connect(key as any, svc as any)}>Connect } ); })} ); }
is related to: useIntegrations
is related to: useDataSources
is related to: useAgent

useIntegrations
type: APIReference
description: Register any HTTPS REST API as a named integration the agent can call as a tool, with credentials encrypted at rest.
article section: integrations
keywords: hook, integrations, Flowstack SDK, useAutomations, useConnections, useDataSources
is part of: Flowstack SDK
programming model: const { integrations, isLoading, error, create, update, remove, get, refresh } = useIntegrations()
example of work: Register, update, and remove an integration
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { useIntegrations } from 'flowstack-sdk'; const { integrations, create, update, remove, isLoading } = useIntegrations(); // Register Shopify await create({ name: 'Shopify', description: 'Shopify Admin API for order and product management', base_url: 'https://my-store.myshopify.com/admin/api/2024-01', auth_type: 'bearer', // 'bearer' | 'api_key_header' | 'api_key_query' | 'basic' | 'none' auth_config: { token: 'shpat_xxx' }, endpoints: [ { name: 'list_orders', method: 'GET', path: '/orders.json' }, { name: 'get_order', method: 'GET', path: '/orders/{id}.json' }, { name: 'cancel_order',method: 'POST', path: '/orders/{id}/cancel.json' }, ], }); // Update credentials await update(id, { auth_config: { token: 'new_token' } }); // Remove await remove(id);
is related to: useAutomations
is related to: useConnections
is related to: useDataSources

API Client
type: APIReference
description: Lower-level promise-based API functions for direct backend access when hooks don't provide enough control.
article section: utilities
keywords: utility, utilities, Flowstack SDK, flowstackFetch, useQuery, useWorkspace, useDatasets
is part of: Flowstack SDK
programming model: fn(credentials, ...params, config?): Promise<ApiResponse<T>>
example of work: Available functions
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { // Auth login, register, // Workspaces listWorkspaces, createWorkspace, getWorkspace, // Datasets listDatasets, getDataset, getDatasetPreview, deleteDataset, // Visualizations & Reports listVisualizations, listReports, // Models & Scripts listModels, getModel, listScripts, // Data Sources listDataSources, createDataSource, testDataSource, deleteDataSource, // Sites listSites, getSite, createSite, addSiteFile, publishStagedSite, deleteSite, // User Management listUsers, getUser, updateUser, deleteUser, suspendUser, reactivateUser, getUserActivity, getUserStats, checkAdminPermissions, // Conversations getConversationHistory, // Query executeQuery, executeQueryWithConfig, // File Upload uploadFile, // Low-level flowstackFetch, } from 'flowstack-sdk';
is related to: flowstackFetch
is related to: useQuery
is related to: useWorkspace
is related to: useDatasets

flowstackFetch
type: APIReference
description: The low-level fetch escape hatch used by every API client function for authenticated requests to the Flowstack backend.
article section: utilities
keywords: utility, utilities, Flowstack SDK, apiClient, executeQuery
is part of: Flowstack SDK
is related to: API Client
is related to: api

CACHE_TTL
type: APIReference
description: Default time-to-live values for the SDK's per-resource client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCached, setCached, deleteCached
is part of: Flowstack SDK
is related to: getCached
is related to: setCached
is related to: deleteCached

getCached
type: APIReference
description: Read a value from the generic per-resource client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, setCached, deleteCached, CACHE_TTL
is part of: Flowstack SDK
example of work: Cache utility imports
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: import { // Generic getCached, setCached, deleteCached, CACHE_TTL, // Resource-specific getCachedWorkspaces, setCachedWorkspaces, invalidateWorkspacesCache, getCachedDatasets, setCachedDatasets, invalidateDatasetsCache, getCachedVisualizations, setCachedVisualizations, invalidateVisualizationsCache, getCachedReports, setCachedReports, invalidateReportsCache, getCachedSites, setCachedSites, invalidateSitesCache, // Bulk invalidation invalidateWorkspaceArtifacts, invalidateAllUserCache, } from 'flowstack-sdk';
is related to: setCached
is related to: deleteCached
is related to: CACHE_TTL

setCached
type: APIReference
description: Write a value into the generic per-resource client-side cache with TTL.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCached, deleteCached, CACHE_TTL
is part of: Flowstack SDK
is related to: getCached
is related to: deleteCached
is related to: CACHE_TTL

deleteCached
type: APIReference
description: Remove a value from the generic per-resource client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCached, setCached, CACHE_TTL
is part of: Flowstack SDK
is related to: getCached
is related to: setCached
is related to: CACHE_TTL

getCachedDatasets
type: APIReference
description: Read the cached list of datasets from the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, setCachedDatasets, invalidateDatasetsCache, useDatasets
is part of: Flowstack SDK
is related to: setCachedDatasets
is related to: invalidateDatasetsCache
is related to: useDatasets

setCachedDatasets
type: APIReference
description: Write the list of datasets into the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedDatasets, invalidateDatasetsCache, useDatasets
is part of: Flowstack SDK
is related to: getCachedDatasets
is related to: invalidateDatasetsCache
is related to: useDatasets

invalidateDatasetsCache
type: APIReference
description: Invalidate the cached list of datasets.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedDatasets, setCachedDatasets, invalidateWorkspaceArtifacts
is part of: Flowstack SDK
is related to: getCachedDatasets
is related to: setCachedDatasets
is related to: invalidateWorkspaceArtifacts

getCachedReports
type: APIReference
description: Read the cached list of reports from the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, setCachedReports, invalidateReportsCache, useReports
is part of: Flowstack SDK
is related to: setCachedReports
is related to: invalidateReportsCache
is related to: useReports

setCachedReports
type: APIReference
description: Write the list of reports into the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedReports, invalidateReportsCache, useReports
is part of: Flowstack SDK
is related to: getCachedReports
is related to: invalidateReportsCache
is related to: useReports

invalidateReportsCache
type: APIReference
description: Invalidate the cached list of reports.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedReports, setCachedReports, invalidateWorkspaceArtifacts
is part of: Flowstack SDK
is related to: getCachedReports
is related to: setCachedReports
is related to: invalidateWorkspaceArtifacts

getCachedSites
type: APIReference
description: Read the cached list of sites from the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, setCachedSites, invalidateSitesCache, useSites
is part of: Flowstack SDK
is related to: setCachedSites
is related to: invalidateSitesCache
is related to: useSites

setCachedSites
type: APIReference
description: Write the list of sites into the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedSites, invalidateSitesCache, useSites
is part of: Flowstack SDK
is related to: getCachedSites
is related to: invalidateSitesCache
is related to: useSites

invalidateSitesCache
type: APIReference
description: Invalidate the cached list of sites.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedSites, setCachedSites, invalidateAllUserCache
is part of: Flowstack SDK
is related to: getCachedSites
is related to: setCachedSites
is related to: invalidateAllUserCache

getCachedVisualizations
type: APIReference
description: Read the cached list of visualizations from the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, setCachedVisualizations, invalidateVisualizationsCache, useVisualizations
is part of: Flowstack SDK
is related to: setCachedVisualizations
is related to: invalidateVisualizationsCache
is related to: useVisualizations

setCachedVisualizations
type: APIReference
description: Write the list of visualizations into the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedVisualizations, invalidateVisualizationsCache, useVisualizations
is part of: Flowstack SDK
is related to: getCachedVisualizations
is related to: invalidateVisualizationsCache
is related to: useVisualizations

invalidateVisualizationsCache
type: APIReference
description: Invalidate the cached list of visualizations.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedVisualizations, setCachedVisualizations, invalidateWorkspaceArtifacts
is part of: Flowstack SDK
is related to: getCachedVisualizations
is related to: setCachedVisualizations
is related to: invalidateWorkspaceArtifacts

getCachedWorkspaces
type: APIReference
description: Read the cached list of workspaces from the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, setCachedWorkspaces, invalidateWorkspacesCache, useWorkspace
is part of: Flowstack SDK
is related to: setCachedWorkspaces
is related to: invalidateWorkspacesCache
is related to: useWorkspace

setCachedWorkspaces
type: APIReference
description: Write the list of workspaces into the client-side cache.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedWorkspaces, invalidateWorkspacesCache, useWorkspace
is part of: Flowstack SDK
is related to: getCachedWorkspaces
is related to: invalidateWorkspacesCache
is related to: useWorkspace

invalidateWorkspacesCache
type: APIReference
description: Invalidate the cached list of workspaces.
article section: utilities
keywords: utility, utilities, Flowstack SDK, getCachedWorkspaces, setCachedWorkspaces, invalidateWorkspaceArtifacts
is part of: Flowstack SDK
is related to: getCachedWorkspaces
is related to: setCachedWorkspaces
is related to: invalidateWorkspaceArtifacts

invalidateAllUserCache
type: APIReference
description: Clear the entire client-side cache for the current user.
article section: utilities
keywords: utility, utilities, Flowstack SDK, invalidateWorkspaceArtifacts
is part of: Flowstack SDK
is related to: invalidateWorkspaceArtifacts

invalidateWorkspaceArtifacts
type: APIReference
description: Invalidate all cached artifacts (datasets, visualizations, reports, etc.) for a workspace.
article section: utilities
keywords: utility, utilities, Flowstack SDK, invalidateAllUserCache, invalidateWorkspacesCache
is part of: Flowstack SDK
is related to: invalidateAllUserCache
is related to: invalidateWorkspacesCache

parseSSELine
type: APIReference
description: Parse a single Server-Sent Events line into a typed StreamEvent.
article section: utilities
keywords: utility, utilities, Flowstack SDK, parseSSEStream, processSSEStream, useAgent
is part of: Flowstack SDK
programming model: const event = parseSSELine(line: string)
example of work: Parse a single SSE line
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: const event = parseSSELine('data: {"type":"content","content":"Hello"}');
is related to: parseSSEStream
is related to: processSSEStream
is related to: useAgent

parseSSEStream
type: APIReference
description: Async generator that yields typed StreamEvents from an agent SSE Response.
article section: utilities
keywords: utility, utilities, Flowstack SDK, parseSSELine, processSSEStream, useAgent, post-stream
is part of: Flowstack SDK
programming model: for await (const event of parseSSEStream(response)) { ... }
example of work: Iterate a full SSE stream
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: for await (const event of parseSSEStream(response)) { switch (event.type) { case 'content': console.log(event.content); break; case 'tool_start': console.log('Tool:', event.tool); break; case 'tool_result': console.log('Result:', event.result); break; case 'done': console.log('Complete'); break; } }
is related to: parseSSELine
is related to: processSSEStream
is related to: useAgent
is related to: api

processSSEStream
type: APIReference
description: High-level helper that drives an agent SSE Response through callbacks.
article section: utilities
keywords: utility, utilities, Flowstack SDK, parseSSEStream, parseSSELine, useAgent, post-stream
is part of: Flowstack SDK
programming model: await processSSEStream(response, callbacks)
example of work: Process a stream with callbacks
  type: SoftwareSourceCode
  programming language: tsx
  code sample type: code snippet
  text: await processSSEStream(response, { onContent: (text) => appendMessage(text), onToolStart: (tool) => showToolIndicator(tool), onDone: () => finalize(), });
is related to: parseSSEStream
is related to: parseSSELine
is related to: useAgent
is related to: api

Sage Data Science Agent REST API
type: WebAPI
description: HTTP + SSE API for Flowstack SDK: 337 operations.
documentation: https://flowstack.fun/docs/rest-api
software version: 2.0.0
is part of: Flowstack SDK
potential action: ConsumeAction
  target: EntryPoint
    url template: https://flowstack.fun/openapi.json
    content type: application/json