Pages (SDK)
SDK methods for PAGE-domain smart products - haiku, tanka, and basic-page.
PAGE-domain smart products represent permanent published writing. PAGE-domain product types include haiku, tanka, sonnet, basic-page, and openletter (the open-letter form used by On-the-record). The content-field table below gives each form's required fields.
Creating a page
Pages are created with rtClient.smartProducts.createPage(input), which returns ApiResponse<SmartProductPage>. See rtClient.smartProducts for the full CreatePageInput shape (contributions, capabilities, constraints).
// Haiku
const { data: page } = await rtClient.smartProducts.createPage({
title: "autumn moon",
productTypeSlug: "haiku",
author: user.stxAddress,
styleSetId: 7,
maxEditions: 100,
minFeeStx: "1000000",
minFeeSbtc: "100",
appId: APP_ID,
content: {
line1: "autumn moon glowing",
line2: "lighting the empty field white",
line3: "a crane calls, calls",
},
});
// Basic page
const { data: prose } = await rtClient.smartProducts.createPage({
title: "A Letter to the River",
productTypeSlug: "basic-page",
author: user.stxAddress,
styleSetId: 3,
maxEditions: 100,
minFeeStx: "1000000",
minFeeSbtc: "100",
appId: APP_ID,
content: {
content: "Dear river, you have always...",
},
});styleSetId is a numeric StyleSet id, and minFeeStx / minFeeSbtc are string micro-amounts (BigInt-on-the-wire). content is a free-form JsonObject - shape it per product type (below).
Content fields by product type
| Product type | Required content fields |
|---|---|
haiku | line1, line2, line3 |
tanka | line1, line2, line3, line4, line5 |
sonnet | line1 to line14 |
basic-page | content |
openletter | content, and recipient (the salutation; leave it blank for the generic one) |
Lifecycle
PAGE products use the simplified lifecycle: DRAFT -> PUBLISHED -> ARCHIVED, with FAILED when a deploy does not land. LOCKED and SETTLED apply to the PREDICTION domain, not PAGE.
Reading pages
const res = await rtClient.smartProducts.list({ domain: "PAGE", status: "PUBLISHED" });
const pages = res.data.items;The core SDK is headless - it has no React hooks. React query hooks for reading smart products ship from @rising-tide/ui. See the React hooks reference.