stageFiles
Client function: stage multiple files in one call (batch form of addSiteFile).
import { stageFiles } from 'flowstack-sdk'Non-React client function. Stages a { path: content } map for a site ahead of a build/publish. POST /api/v1/sites/{siteId}/staged with { files }.
Signature
stageFiles(credentials, siteId, files, config?): Promise<ApiResponse<{ staged: boolean; site_id: string; staged_count: number; paths: string[]; total_bytes: number }>>Parameters
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required | The app owner's credentials (owner-scoped JWT). |
siteId | string | required | The site/app id to operate on. |
files | Record<string, string> | required | Map of file path → file content to stage. |
config | FlowstackClientConfig | since 0.2.7 | Client config (baseUrl, appScope, tenantId as needed). |
Returns
| Field | Type | Description |
|---|---|---|
| — | Promise<ApiResponse<{ staged: boolean; site_id: string; staged_count: number; paths: string[]; total_bytes: number }>> | Count, paths, and total bytes of what was staged. |
Examples
Stage two files
const res = await stageFiles(credentials, siteId, {
'index.html': '<h1>hi</h1>',
'app.js': 'console.log(1)',
}, { appScope });WarningOwner/management operation — call it with the app owner's credentials from a builder/dashboard/server context, not from inside the generated app's end-user runtime.
builtAppSafe is false.See also
listStagedFiles · clearStagedFiles · getAppSource
Source: src/api/client.ts (Site Ops, P0-156) · Also available in llms-full.txt and registry.json.