developers

Docs SDK Loaders

Loaders

Server-side data loaders. Call them from a Server Component; each returns a typed view-model the platform guarantees, so a theme never writes a query and never sees a raw table. The signed-in customer's orders, subscriptions, addresses and profile are read only by the platform's own account pages.

availabilityEvent
availabilityEvent(res: Pick<Availability, "event"> | null | undefined,): AvailabilityEvent | null
Normalize an availability answer's `event` block; null when the listing is not a single event (no block) or the block is malformed.
packages/theme-sdk/src/loaders/getListingAvailability.ts
getAnnouncement
getAnnouncement(): Promise<Announcement | null>
GET /sites-announcements → AnnouncementView | null (§3.11).
packages/theme-sdk/src/loaders/getAnnouncement.ts
getAuthContext
getAuthContext(): Promise<AuthContext | null>
resolve the current auth session + customer link.
packages/theme-sdk/src/loaders/getAuthContext.ts
getBlogPost
getBlogPost(slug: string): Promise<BlogPostDetail | null>
getBlogPosts / getBlogPost — GET /sites-blog (Paged<BlogPostCardView>) and GET /sites-blog/{slug} (BlogPostDetailView).
packages/theme-sdk/src/loaders/getBlog.ts
getBlogPosts
getBlogPosts(options: GetBlogPostsOptions = {}): Promise<BlogPage>
getBlogPosts / getBlogPost — GET /sites-blog (Paged<BlogPostCardView>) and GET /sites-blog/{slug} (BlogPostDetailView).
packages/theme-sdk/src/loaders/getBlog.ts
getCategories
getCategories(): Promise<Category[]>
fetch the tenant's category taxonomy.
packages/theme-sdk/src/loaders/getCategories.ts
getCategoryCards
getCategoryCards(): Promise<CategoryCard[]>
The same taxonomy as `getCategories`, mapped to the RICHER `CategoryCard` shape — image, url path and active listing count.
packages/theme-sdk/src/loaders/getCategories.ts
getContent
getContent(// eslint-disable-next-line @typescript-eslint/no-unused-vars input: GetContentInput,): Promise<Content | null>
fetch a generic content entry by slug.
packages/theme-sdk/src/loaders/getContent.ts
getCurrentThemeId
getCurrentThemeId(): string | null
currentThemeId — request-scoped slot for the active theme's CANONICAL registered id (e.g., `"mecsto/anchor"`).
packages/theme-sdk/src/loaders/currentThemeId.ts
getEditable
server-side per-field editable-content reader.
packages/theme-sdk/src/loaders/getEditable.ts
getEditableOverrides
getEditableOverrides(input: GetEditableOverridesInput,): Promise<Record<string, EditableValue>>
fetch ALL content overrides for a tenant + theme.
packages/theme-sdk/src/loaders/getEditableOverrides.ts
getEditableOverridesWithDrafts
getEditableOverridesWithDrafts(input: GetEditableOverridesWithDraftsInput,): Promise<Record<string, EditableValue>>
preview-mode counterpart to `getEditableOverrides`.
packages/theme-sdk/src/loaders/getEditableOverridesWithDrafts.ts
getFaqs
getFaqs(): Promise<Faq[]>
GET /sites-faqs → FaqView[] (contract §3.8).
packages/theme-sdk/src/loaders/getFaqs.ts
getListing
getListing(slug: string): Promise<Listing | null>
fetch a single listing by slug.
packages/theme-sdk/src/loaders/getListing.ts
getListingAvailability
getListingAvailability(args: GetListingAvailabilityInput,): Promise<Availability | null>
fetch bookable slots for a listing over a date window.
packages/theme-sdk/src/loaders/getListingAvailability.ts
getListings
getListings(options: FetchListingsOptions = {}): Promise<Listing[]>
fetch the tenant's listings, optionally filtered.
packages/theme-sdk/src/loaders/getListings.ts
getListingsPage
getListingsPage(options: FetchListingsOptions = {}): Promise<ListingsPage>
Like getListings but also returns the pagination block.
packages/theme-sdk/src/loaders/getListings.ts
getLocations
getLocations(): Promise<Location[]>
GET /sites-locations → LocationView[] (§3.5).
packages/theme-sdk/src/loaders/getLocations.ts
getMerchantModel
getMerchantModel(): Promise<MerchantModel>
fetch the resolved Merchant Model SINGLETONS for the tenant.
packages/theme-sdk/src/loaders/getMerchantModel.ts
getNavigation
getNavigation(): Promise<Navigation>
GET /sites-navigation → NavigationView {primary,footer} (§3.15).
packages/theme-sdk/src/loaders/getNavigation.ts
getPageComposition
getPageComposition(pageType: string, opts: GetPageCompositionOptions = {},): Promise<AnyPageComposition | null>
GET /sites-page-composition/{page_type}[/{slug}] → PageCompositionView (Tier-1 composition).
packages/theme-sdk/src/loaders/getPageComposition.ts
getStore
getStore(): Promise<Store | null>
fetch the resolved tenant's full Store view.
packages/theme-sdk/src/loaders/getStore.ts
getTeam
getTeam(): Promise<TeamMember[]>
GET /sites-team → TeamMemberView[] (§3.10).
packages/theme-sdk/src/loaders/getTeam.ts
getTeamProfiles
getTeamProfiles(): Promise<TeamProfile[]>
legacy lean team loader.
packages/theme-sdk/src/loaders/getTeamProfiles.ts
getTenantContext
getTenantContext(): Promise<TenantContext | null>
resolve the tenant from request headers.
packages/theme-sdk/src/loaders/getTenantContext.ts
getTestimonials
getTestimonials(): Promise<Testimonial[]>
GET /sites-testimonials → TestimonialView[] (§3.9).
packages/theme-sdk/src/loaders/getTestimonials.ts
getTokens
getTokens(input: GetTokensInput): Promise<TokenSet>
server-side wrapper around `resolveTokens()`.
packages/theme-sdk/src/loaders/getTokens.ts
isPreviewMode
a NON-PRIVILEGED hint that the request LOOKS like a preview session.
packages/theme-sdk/src/loaders/isPreviewMode.ts
previewTokenFromSearchParams
previewTokenFromSearchParams(searchParams?: Record<string, string | string[] | undefined>,): string | undefined
Extract the preview-session JWT from a page's `searchParams` (`?preview_session=`).
packages/theme-sdk/src/loaders/getPageComposition.ts

Platform-only, not for themes: getMyAddresses, getMyLoyalty, getMyOrder, getMyOrders, getMyProfile, getMySubscriptions. The SDK exports them for the platform’s own sign-in, account and checkout pages; the build fails a theme that imports them. Link to those pages instead — see account pages.