getAppSource
Client function: fetch a version's source files as a { path: content } map (live version by default).
import { getAppSource } from 'flowstack-sdk'Non-React client function. Returns the source tree for a site version. Omit version for the live version. GET /api/v1/sites/{siteId}/source?version={n}.
Signature
getAppSource(credentials, siteId, version?, config?): Promise<ApiResponse<AppSource>>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. |
version | number | — | Specific version to fetch. Defaults to the live version. |
config | FlowstackClientConfig | since 0.2.7 | Client config (baseUrl, appScope, tenantId as needed). |
Returns
| Field | Type | Description |
|---|---|---|
| — | Promise<ApiResponse<AppSource>> | AppSource: { site_id, version, files: Record<string, string> } (version is null for legacy unversioned sites). |
Examples
Read the live source
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);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
Source: src/api/client.ts (Site Ops, P0-156) · Also available in llms-full.txt and registry.json.