Skip to content

ContentApi

Defined in: packages/sdk/src/resources/ContentApi.ts:9

Read + write the per-website content document. The document is a free-form JSON blob the site template renders against; the API stores it in the site’s repo and returns a SHA for optimistic-concurrency on save.

  • Resource

new ContentApi(opts): ContentApi

Defined in: packages/sdk/src/request.ts:93

VantageClientOptions

ContentApi

Resource.constructor

get(websiteId): Promise<{ content: Record<string, unknown> | null; sha: string | null; }>

Defined in: packages/sdk/src/resources/ContentApi.ts:14

Read the website’s content document. Returns the parsed object

  • the SHA used for optimistic-concurrency on save.

string

Promise<{ content: Record<string, unknown> | null; sha: string | null; }>


save(websiteId, content, sha?): Promise<{ sha: string; }>

Defined in: packages/sdk/src/resources/ContentApi.ts:24

Save a new content document. Pass the SHA from the most recent get for optimistic-concurrency; omit on the first write.

string

Record<string, unknown>

string | null

Promise<{ sha: string; }>