Docs / built-apps / stageFiles

stageFiles

utilitysince 0.2.7not for built apps

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

ParamTypeNotesDescription
credentialsFlowstackCredentialsrequiredThe app owner's credentials (owner-scoped JWT).
siteIdstringrequiredThe site/app id to operate on.
filesRecord<string, string>requiredMap of file path → file content to stage.
configFlowstackClientConfigsince 0.2.7Client config (baseUrl, appScope, tenantId as needed).

Returns

FieldTypeDescription
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.