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.
Extends
Section titled “Extends”Resource
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ContentApi(
opts):ContentApi
Defined in: packages/sdk/src/request.ts:93
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ContentApi
Inherited from
Section titled “Inherited from”Resource.constructor
Methods
Section titled “Methods”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.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<{ content: Record<string, unknown> | null; sha: string | null; }>
save()
Section titled “save()”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.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
content
Section titled “content”Record<string, unknown>
string | null
Returns
Section titled “Returns”Promise<{ sha: string; }>