Skip to content

storyblok API

Everything the package exports, by the path you import it from. Open an export for its signature and options.

@evolve-framework/storyblok

StoryblokModule, the built-in content blocks and defineContentBlock for your own, the Storyblok clients, and catalog page sync.

Classes

MapperRegistryRegistry of mappers keyed by Storyblok component name.
import { MapperRegistry } from "@evolve-framework/storyblok";

Bloks go through three channels. mapValue is the universal one: every block mapper is reachable there by component name, and it is how a container maps its children without importing the blocks that produce them. mapBlock and mapColumnEntry are typed views over the two GraphQL unions, for fields whose type is the union (a page body, a column) and which therefore need no assertion at the call site. Whole stories go through a fourth, mapPage, keyed by the component of the story's content.

Registering a mapper for an already-known component overrides the previous registration without throwing. A blok for other markets than the request's maps to nothing in every channel but mapPage.

new MapperRegistry()
MethodDescription
registerBlock(component: string, mapper: BlockMapper): MapperRegistry
registerColumnEntry( component: string, mapper: ColumnEntryMapper, ): this
registerValue( component: string, mapper: ContentBlockMapper, ): this
registerPage(component: string, mapper: PageMapper): MapperRegistry
hasBlock(component: string): boolean
hasColumnEntry(component: string): boolean
hasValue(component: string): boolean
hasPage(component: string): boolean
mapBlock( storeContext: StoreContext, blok: StoryblokBlok, ): Block | undefined
mapColumnEntry( storeContext: StoreContext, blok: StoryblokBlok, ): ColumnEntry | undefined
mapValue<T>( storeContext: StoreContext, blok: StoryblokBlok, ): T | undefinedMap a child blok by its component name.
mapPage( story: ISbStoryData<ISbComponentType<string> & { [index: string]: any; }>, storeContext: StoreContext, ): MappedPageMap a story by its content's component name; an unknown one throws.
StoreContextThe store, locale and currency a request is for, from its X-StoreContext-* headers.
import { StoreContext } from "@evolve-framework/storyblok";
new StoreContext(storeContext: StoreContextInput)
OptionTypeDescription
currencystring

The currency used in the store context.

localestring

The locale of the store context. For example: en-US.

storeKeystring

The store key associated with the store context.

country?InputMaybe<string>

The market the store context is for; leave out for every market.

StoryblokModuleModule wiring Storyblok resolvers, typedefs and webhook into a Domain Service.
import { StoryblokModule } from "@evolve-framework/storyblok";

Pass either a pre-built clients bundle (from createStoryblokClients) or a config object; the module will build its own clients from config during init().

Only one StoryblokModule instance per process is supported -- clients are held as module-scope singletons.

Extends AbstractModule<StoryblokLoaderContext>

new StoryblokModule(options: StoryblokModuleOptions)
OptionTypeDescription
messagePublisherMessagePublisher

Publisher used to emit content-modified events from the webhook. Pass a messagePublisher from a cloud adapter (e.g. new SqsPublisher(...)) or a NoopPublisher to disable publishing.

webhookSecretstring

The webhook secret set on the space's webhook in Storyblok. A delivery whose webhook-signature does not match it is refused with a 401.

siteConfigs?SiteConfig[]

Site configurations used to compute translated paths for catalog and content pages. Defaults to an empty array (no translated paths).

origin?string

Origin name attached to outbound content-modified events emitted by the webhook. Defaults to "cms".

webhookPath?string

URL path the webhook is registered on. Defaults to "/api/webhook".

blocks?ContentBlockDef[]

The complete set of content blocks the module serves. Defaults to the built-in contentBlocks; spread it to add or replace, e.g. blocks: [...contentBlocks, myBlock] (a block whose id matches a built-in replaces it). Each block's mapper is registered and its SDL fragment merged into the served schema.

mappers?((registry: MapperRegistry) => void)

Optional callback invoked with the pre-populated MapperRegistry. Use it to add or override mappers for custom Storyblok components.

articlesPerProduct?number

How many articles a product shows at most. Defaults to 4.

siteRevalidation?SiteRevalidationOptions

The sites whose caches a publish purges: their revalidate URLs and the secret they share with this service. The locales purged are those of siteConfigs. Without it the webhook purges only this service's caches.

clients?StoryblokClients

Clients the module uses as they are, typically from createStoryblokClients. Pass either this or config.

config?StoryblokConfig

Settings the module builds its own clients from with createStoryblokClients during init(). Pass either this or clients.

Functions

componentFromArrayThe first component of a blocks field, as T; undefined for an empty field.
import { componentFromArray } from "@evolve-framework/storyblok";
function componentFromArray<T>(raw: unknown): T

Returns T

convertStoryblokRichTextStoryblok's rich text document as the vendor-neutral tree.
import { convertStoryblokRichText } from "@evolve-framework/storyblok";
function convertStoryblokRichText<Embed>(
document: unknown,
options: StoryblokRichTextOptions<Embed>,
): ConvertedRichText<Embed>
OptionTypeDescription
prefixstring

Keeps this document's ref ids apart from another's on the same page.

localestring

The store's locale, which a linked story's path is given without.

embed?((blok: unknown, id: string) => Embed | undefined)

A blok placed in the text as an embed, or undefined to leave it out.

Returns ConvertedRichText<Embed>

createStoryblokClientsThe two clients for config.
import { createStoryblokClients } from "@evolve-framework/storyblok";
function createStoryblokClients(config: StoryblokConfig): StoryblokClients
OptionTypeDescription
accessTokenstring

Public delivery API access token.

spaceIdnumber

Storyblok space id.

categoryFolderIdnumber

Parent folder id used when upserting catalog category pages.

managementToken?string

OAuth management token used by event handlers.

region?"eu" | "us" | "ap" | "ca" | "cn"

Storyblok region (defaults to "eu").

defaultLanguage?string

The language whose slug a story carries as its own, with every other language beside it as a translated slug. Defaults to en-GB.

More

It has to be the space's default language: a story's slug is the default language's, so naming a different one here grows a second tree of pages next to the one the space resolves.

Returns StoryblokClients

defineContentBlockDefines a content block.
import { defineContentBlock } from "@evolve-framework/storyblok";
mapper: (storeContext, blok: StoryblokCampaignBanner): CampaignBanner => ({ ... })

The output type is erased on the way out, because a block is meant to be reached through the registry rather than called directly -- that is what lets a container map its children without importing them. Dispatch through mapBlock / mapColumnEntry / mapValue to get a typed result back.

function defineContentBlock<TBlok, TOutput>(
config: { id: string; typename: string; typeDefs?: string | undefined; terraform?: string | undefined; groups?: string[] | undefined; slots?: Record<string, Slot> | undefined; mapper: (storeContext: StoreContext, blok: TBlok) => TOutput; },
): ContentBlockDef & {
mapper: ContentBlockMapper;
}
OptionTypeDescription
idstring
typenamestring
mapper(storeContext: StoreContext, blok: TBlok) => TOutput
typeDefs?string
terraform?string
groups?string[]
slots?Record<string, Slot>

Returns ContentBlockDef & { mapper: ContentBlockMapper; }

generateTerraformAssembles the Terraform module as a single combined HCL string (the locals block followed by every block's Terraform).
import { generateTerraform } from "@evolve-framework/storyblok";
function generateTerraform(blocks: ContentBlockDef[]): string

Returns string

getFolderSlugThe folder a story sits in, as the full slug up to and including its last slash, in the default language as starts_with matches it.
import { getFolderSlug } from "@evolve-framework/storyblok";
function getFolderSlug(story: ISbStoryData<unknown>): string

Returns string

getLocalizedSlugA linked story's slug in a locale such as nl-NL: its translated slug where it has one, otherwise its full slug.
import { getLocalizedSlug } from "@evolve-framework/storyblok";
function getLocalizedSlug(
story: { full_slug?: string | undefined; translated_slugs?: TranslatedSlug[] | null | undefined; },
locale: string,
): string | undefined
OptionTypeDescription
full_slug?string
translated_slugs?TranslatedSlug[] | null

Returns string | undefined

getMapperRegistryThe registry StoryblokModule set up; throws before one is constructed.
import { getMapperRegistry } from "@evolve-framework/storyblok";
function getMapperRegistry(): MapperRegistry

Returns MapperRegistry

getPagePathThe path a frontend routes a story on: no locale prefix and no category folder, with the homepage as "/".
import { getPagePath } from "@evolve-framework/storyblok";
function getPagePath(story: ISbStoryData<unknown>): string

Returns string

getStoryblokClientsThe clients StoryblokModule set up; throws before one is constructed.
import { getStoryblokClients } from "@evolve-framework/storyblok";
function getStoryblokClients(): StoryblokClients

Returns StoryblokClients

getTranslatedNameA story's name in a locale.
import { getTranslatedName } from "@evolve-framework/storyblok";
function getTranslatedName(story: ISbStoryData<unknown>, locale: string): string

Returns string

getTranslatedPathsThe path of a story in every locale of every configured site.
import { getTranslatedPaths } from "@evolve-framework/storyblok";
function getTranslatedPaths(
story: ISbStoryData<unknown>,
): Array<{
locale: string;
path: string;
}>

Returns Array<{ locale: string; path: string; }>

keysOfThe commerce keys in a field that holds one key per line, such as a categories or brands field, as Storyblok has no list-of-text field.
import { keysOf } from "@evolve-framework/storyblok";
function keysOf(value: string | undefined): string[]

Returns string[]

linkedStoryNameA linked story's name in the requested language.
import { linkedStoryName } from "@evolve-framework/storyblok";
function linkedStoryName(
story: { name?: string | undefined; } | undefined,
): string | undefined
OptionTypeDescription
name?string

Returns string | undefined

mapAssetA Storyblok asset as a ContentAsset, with the focal point at the centre of the area the editor marked, where there is one.
import { mapAsset } from "@evolve-framework/storyblok";
function mapAsset(asset: StoryblokAsset): ContentAsset
OptionTypeDescription
altstring | null
copyrightstring | null
fieldtype"asset"
idnumber
filenamestring | null
namestring
titlestring | null
focusstring | null
meta_dataRecord<string, any>
sourcestring | null
is_external_urlboolean
is_privateboolean
srcstring
updated_atstring
widthnumber | null
heightnumber | null
aspect_rationumber | null
public_idstring | null
content_typestring

Returns ContentAsset

mapBlocksMaps a story's body (a list of raw bloks) onto the Block union, dispatching each blok through the mapper registry on its component name.
import { mapBlocks } from "@evolve-framework/storyblok";

A blok registered only as a column entry (a FAQ) is answered as Columns holding that one entry, so an editor can drop column content straight into a page body and still get a Block back; rich text is a block of its own. Bloks with no mapper at all are logged and dropped, and so is a blok whose mapper throws, so that one malformed blok cannot fail the page or listing it is part of. storySlug only labels the log entry. A blok whose mapper answers a list, as snippet does with the blocks it places, is inlined.

function mapBlocks(
body: StoryblokBlok[] | undefined,
storeContext: StoreContext,
storySlug?: string,
): Block[]

Returns Block[]

mapBlockSettingsThe settings every block of the content model carries: the anchor an in-page link points to, and who the block is shown to, everyone where unset.
import { mapBlockSettings } from "@evolve-framework/storyblok";
function mapBlockSettings(
blok: { anchor?: string | undefined; audience?: string | undefined; },
): {
anchor: string | undefined;
audience: AudienceType;
}
OptionTypeDescription
anchor?string
audience?string

Returns { anchor: string | undefined; audience: AudienceType; }

mapCategoriesA categories field as the categories the commerce subgraph resolves by key.
import { mapCategories } from "@evolve-framework/storyblok";
function mapCategories(value: string | undefined): ProductCategory[]

Returns ProductCategory[]

mapPageA story of any page type, by the page mapper registered for its content's component; a project's own page type replaces the built-in of the same name.
import { mapPage } from "@evolve-framework/storyblok";
function mapPage(
story: ISbStoryData<ISbComponentType<string> & { [index: string]: any; }>,
storeContext: StoreContext,
): MappedPage

Returns MappedPage

mapPageMetaA page's metadata from its three SEO fields, the same in every CMS; the image falls back to the page's lead image where it has one.
import { mapPageMeta } from "@evolve-framework/storyblok";
function mapPageMeta(
content: Pick<StoryblokContentPage, "seoTitle" | "seoDescription" | "seoImage">,
fallbackImage?: string | null,
): PageMeta | undefined
OptionTypeDescription
seoTitle?string
seoDescription?string
seoImage?StoryblokAsset

Returns PageMeta | undefined

removeLocaleFromPathpath without a leading locale folder, in full or language-only form, and with homepage removed.
import { removeLocaleFromPath } from "@evolve-framework/storyblok";
function removeLocaleFromPath(path: string, locale: string): string

Returns string

resolvedStoryA story an options field refers to, where the request resolved it.
import { resolvedStory } from "@evolve-framework/storyblok";
function resolvedStory<T>(
value: string | ISbStoryData<T> | undefined,
): ISbStoryData<T> | undefined

Returns ISbStoryData<T> | undefined

terraformFilesAssembles the Terraform module as a set of files: a generated block_locals.tf (whitelist locals from group membership) plus one block_<snake id>.tf per block that carries Terraform.
import { terraformFiles } from "@evolve-framework/storyblok";

The generated file is named block_locals.tf rather than locals.tf so it sits alongside a consumer's own hand-owned locals.tf (space id, component groups, ...) -- Terraform merges the two locals blocks.

function terraformFiles(blocks: ContentBlockDef[]): TerraformFile[]

Returns TerraformFile[]

toColumnsRatioA stored columns ratio option as the schema's enum; fallback when unset or unknown.
import { toColumnsRatio } from "@evolve-framework/storyblok";
function toColumnsRatio(
value: string | undefined,
fallback: ColumnsRatioType,
): ColumnsRatioType

Returns ColumnsRatioType

upsertCatalogPageCreate the catalog page for a category, and whatever folders above it are still missing.
import { upsertCatalogPage } from "@evolve-framework/storyblok";

Returns what it did, so a backfill can report rather than guess. A category that already has a page is left alone: what arrives here is a category, not a page — no hero, no copy, no meta — and everything beyond that is an editor's to fill in. Moving an existing page after a category was renamed is a separate decision, since it changes a URL an editor may have shared.

function upsertCatalogPage(
input: CatalogPageInput,
): Promise<"created" | "unchanged">
OptionTypeDescription
categoryIdstring

The engine's category id. The join key, and the natural key.

nameRecord<string, string>

Category name per language, e.g. { "en-GB": "Bikes" }.

pathstring | Record<string, string>

The path the storefront routes, without the category prefix.

More

Per language where the engine translates its slugs — sport/fietsen in Dutch, sport/bikes in English — or one string when it does not.

Returns Promise<"created" | "unchanged">

writeTerraformWrites the assembled Terraform module for blocks to outputDir (created if needed): a generated block_locals.tf plus one block_<component>.tf per block.
import { writeTerraform } from "@evolve-framework/storyblok";

Only resource/locals blocks are emitted -- provider, backend and required_providers config are the consumer's to own.

function writeTerraform(blocks: ContentBlockDef[], outputDir: string): string[]

Returns string[]

Constants

blocksBuilt-in content blocks keyed by their Storyblok component name.
import { blocks } from "@evolve-framework/storyblok";
const blocks: Record<string, ContentBlockDef>
contentBlocksBuilt-in content blocks.
import { contentBlocks } from "@evolve-framework/storyblok";
const contentBlocks: ContentBlockDef[]
pageTypesThe built-in page types.
import { pageTypes } from "@evolve-framework/storyblok";
const pageTypes: ContentBlockDef[]
storyblokDataLoadersThe Storyblok loaders a module declares, built per request from it.
import { storyblokDataLoaders } from "@evolve-framework/storyblok";
const storyblokDataLoaders: DataLoaderDefinition<StoryblokLoaderContext, { contentSnippetsByKey: DataLoader<string, ISbStoryData<StoryblokContentSnippet> | null, string>; articlesByCategor…

Types

BlockMapperMaps a blok to a page block, or undefined to leave it out.
import { type BlockMapper } from "@evolve-framework/storyblok";
export type BlockMapper = (storeContext: StoreContext, blok: StoryblokBlok) => Block | undefined;
ColumnEntryMapperMaps a blok to a column entry, or undefined to leave it out.
import { type ColumnEntryMapper } from "@evolve-framework/storyblok";
export type ColumnEntryMapper = (storeContext: StoreContext, blok: StoryblokBlok) => ColumnEntry | undefined;
ContentBlockDefA content block bundles everything one Storyblok component needs: its output typename, SDL fragment, mapper (Storyblok blok -> GraphQL type), the Terraform that provisions it, and its composition metadata (which groups it belongs to, and which slots it exposes).
import { type ContentBlockDef } from "@evolve-framework/storyblok";

A block references other blocks only by component name or group -- never by import -- so any one can be ejected while still referencing the rest. A container maps its children by dispatching them through the registry on their component name, so each block owns the mapping of its own component and nothing else.

export type ContentBlockDef = {
id: string;
typename: string;
typeDefs?: string;
terraform?: string;
groups?: GroupId[];
slots?: Record<string, Slot>;
mapper?: ContentBlockMapper;
pageMapper?: PageMapper;
};
ContentBlockMapperThe registry-facing mapper: takes an untyped blok and returns whatever the block's GraphQL type is.
import { type ContentBlockMapper } from "@evolve-framework/storyblok";
export type ContentBlockMapper = (storeContext: StoreContext, blok: StoryblokBlok) => unknown;
ContextValueThe GraphQL context the Storyblok resolvers read.
import { type ContextValue } from "@evolve-framework/storyblok";
export type ContextValue = {
request: Request;
storeContext: StoreContext;
loaders: {
contentSnippetsByKey: DataLoader<string, ISbStoryData<StoryblokContentSnippet> | null>;
articlesByCategoryTrail: DataLoader<string, ISbStoryData[]>;
sectionByFolder: DataLoader<string, ISbStoryData<StoryblokArticleOverviewPage> | null>;
catalogPageByCategory: DataLoader<string, ISbStoryData<StoryblokCatalogPage> | undefined>;
pageTypeByStory: DataLoader<string, PageType | undefined>;
};
links?: ISbLinkURLObject[];
};
GroupIdA slot-group: a named set of blocks that can fill a slot.
import { type GroupId } from "@evolve-framework/storyblok";
export type GroupId = string;
MappedArticlePageAn article with the folder it sits in, which the section field resolver reads, since the section is the overview that starts that folder.
import { type MappedArticlePage } from "@evolve-framework/storyblok";
export type MappedArticlePage = ArticlePage & {
folder: string;
relatedQuery?: {
topics: string[];
excluding: string;
limit: number;
};
};
MappedPageEach concrete page type, so a caller can return it as one.
import { type MappedPage } from "@evolve-framework/storyblok";
export type MappedPage = ArticleOverviewPage | MappedArticlePage | CatalogPage | ContentPage;
MappedPromoA Promo whose link is still a MappedLink.
import { type MappedPromo } from "@evolve-framework/storyblok";
export type MappedPromo = Omit<Promo, "link"> & {
link?: MappedLink;
};
PageMapperMaps a whole story of a page type onto its GraphQL page.
import { type PageMapper } from "@evolve-framework/storyblok";
export type PageMapper = (story: ISbStoryData, storeContext: StoreContext) => MappedPage;
SiteConfigA site the content serves: its country and the languages it is published in.
import { type SiteConfig } from "@evolve-framework/storyblok";
export type SiteConfig = {
country: string;
languages: string[];
};
SlotA named containment point a block exposes.
import { type Slot } from "@evolve-framework/storyblok";
export type Slot = {
accepts: SlotAccepts;
};
SlotAcceptsWhat a slot accepts.
import { type SlotAccepts } from "@evolve-framework/storyblok";
export type SlotAccepts = GroupId | {
group?: GroupId;
ids?: string[];
};
StoryblokBlokThe shape every raw Storyblok blok shares.
import { type StoryblokBlok } from "@evolve-framework/storyblok";
export type StoryblokBlok = {
component: string;
_uid: string;
[key: string]: unknown;
};
StoryblokClientsThe delivery and management clients for one space, with the settings they were built from.
import { type StoryblokClients } from "@evolve-framework/storyblok";
export type StoryblokClients = {
client: StoryblokClient;
managementClient: StoryblokClient;
spaceId: number;
categoryFolderId: number;
accessToken: string;
defaultLanguage: string;
};
StoryblokLoaderContextWhat these loaders read off the request context.
import { type StoryblokLoaderContext } from "@evolve-framework/storyblok";
export type StoryblokLoaderContext = {
request: Request;
};
TerraformFileA single generated Terraform file: its name and HCL contents.
import { type TerraformFile } from "@evolve-framework/storyblok";
export type TerraformFile = {
filename: string;
content: string;
};

@evolve-framework/storyblok/graphql/context

The request context the module's resolvers expect.

Classes

StoreContextThe store, locale and currency a request is for, from its X-StoreContext-* headers.
import { StoreContext } from "@evolve-framework/storyblok/graphql/context";
new StoreContext(storeContext: StoreContextInput)
OptionTypeDescription
currencystring

The currency used in the store context.

localestring

The locale of the store context. For example: en-US.

storeKeystring

The store key associated with the store context.

country?InputMaybe<string>

The market the store context is for; leave out for every market.

Functions

initContextValueThe context for a request: its store context and the data loaders.
import { initContextValue } from "@evolve-framework/storyblok/graphql/context";
function initContextValue({ request }: YogaInitialContext): ContextValue

Returns ContextValue

Types

ContextValueThe GraphQL context the Storyblok resolvers read.
import { type ContextValue } from "@evolve-framework/storyblok/graphql/context";
export type ContextValue = {
request: Request;
storeContext: StoreContext;
loaders: {
contentSnippetsByKey: DataLoader<string, ISbStoryData<StoryblokContentSnippet> | null>;
articlesByCategoryTrail: DataLoader<string, ISbStoryData[]>;
sectionByFolder: DataLoader<string, ISbStoryData<StoryblokArticleOverviewPage> | null>;
catalogPageByCategory: DataLoader<string, ISbStoryData<StoryblokCatalogPage> | undefined>;
pageTypeByStory: DataLoader<string, PageType | undefined>;
};
links?: ISbLinkURLObject[];
};

@evolve-framework/storyblok/graphql/types

The generated GraphQL types of the content contract.

Generated types237Generated from the schema, one per type.
ArticleListArticle cards: the articles the editor picked, or else the newest that match its filters on section, topic and category.
ArticleListResolvers
ArticleOverviewPageThe overview of one section of articles, such as a blog or the buying guides.
ArticleOverviewPageResolvers
ArticlePageAn article, such as a blog post, a buying guide or a news item: a page whose text owns it.
ArticlePageResolvers
ArticleResultOne page of articles, newest first.
ArticleResultResolvers
AudienceTypeWho a block is shown to.
AuthorWho wrote an article, as the byline and the author markup name them.
AuthorResolvers
BlockRich text is also a block of its own, placed directly in a page body.
BlockResolvers
BrandA brand.
BrandListBrand logos that link to their brand pages, in the order the editor placed them.
BrandListResolvers
BrandResolvers
BreadcrumbRepresents a single item in a breadcrumb trail.
BreadcrumbResolvers
BreadcrumbTypeRepresents different types of breadcrumbs in the navigation structure.
CampaignBannerA campaign: an image with the text beside it, not on it, and one call to action.
CampaignBannerResolvers
CatalogPageRepresents a product listing page with its surrounding content.
CatalogPageFacetFilterOne facet of a curated collection and the values it selects.
CatalogPageFacetFilterInputOne facet of a listing's filter and the values it selects.
CatalogPageFacetFilterResolvers
CatalogPageLayoutTypeHow a catalog page presents its category.
CatalogPageResolvers
CategoryListEntrances to categories: the ones the editor picked, or the children of one category.
CategoryListResolvers
ColumnEntryRepresents content types that can be used in columns.
ColumnEntryResolvers
ColumnsTwo to four blocks side by side, stacked in their order on a narrow screen.
ColumnsRatioTypeHow the width is shared between two columns, in the order they are placed.
ColumnsResolvers
ContentAssetRepresents a content asset, such as an image or file.
ContentAssetResolvers
ContentPageRepresents a content page with various sections and blocks.
ContentPageResolvers
ContentSearchHitA page or an article that matches a search.
ContentSearchHitResolvers
ContentSearchResultWhat the CMS answers to a search term.
ContentSearchResultResolvers
ContentSnippetRepresents a snippet of content that can be used in various places.
ContentSnippetResolvers
ContentTeaserAn image beside text, or text alone, with up to two links.
ContentTeaserResolvers
ContentVersionTypeSpecifies different versions of content.
CountryCodeScalarConfig
CurrencyScalarConfig
DateScalarConfig
DateTimeScalarConfig
DirectiveResolverFn
DirectiveResolvers
EmailAddressScalarConfig
ErrorShared interface for every error returned as data.
ErrorResolvers
Faq
FaqGroup
FaqGroupResolvers
FaqItem
FaqItemResolvers
FaqResolvers
FederationReferenceTypesMapping of federation reference types
FederationTypesMapping of federation types
FieldValidationIssueA single field-level validation failure, to attach to its input control
FieldValidationIssueResolvers
FigureOne key figure: a value with what it measures.
FigureListTwo to four key figures.
FigureListResolvers
FigureResolvers
FocalPointA point in an image, in percent from its left and top edges.
FocalPointResolvers
GraphQLRecursivePick
HotspotOne product pinned on a shoppable image.
HotspotResolvers
ImageOne image, or a pair side by side.
ImageResolvers
InputMaybe
IsTypeOfResolverFn
JsonScalarConfig
LinkA link with its own label, to one target: a page, a product, a storefront route or a URL.
LinkKindTypeWhat a resolved link points at: a page of the site, or a URL.
LinkResolvers
LinkVariantTypeHow prominently a link is drawn.
LocaleScalarConfig
Maybe
MenuItemOne menu entry: a link, or a heading for the entries below it.
MenuItemResolvers
MessagesThe store's fixed system copy, one entry per store, for the places no editor fills by hand.
MessagesResolvers
MutationDefines the available mutations in the schema.
MutationResolvers
MutationStoreContentPreviewArgsDefines the available mutations in the schema.
NavigationA menu: the header's, the footer's, or one of the project's own.
NavigationResolvers
NextResolverFn
Omit
OpenGraphOpen Graph protocol metadata for social media sharing
OpenGraphResolvers
PageA page a route can land on.
PageMetaPage metadata for SEO, from the page's three SEO fields.
PageMetaResolvers
PageRedirectWhere a path sends a visitor: written by an editor, or by the CMS when a page's path changed, from the old path to the page.
PageRedirectResolvers
PageResolvers
PageSortOrderTypeSpecifies sorting options for pages.
PagesResultRepresents the result of a query for multiple pages.
PagesResultResolvers
PageTypeDefines the different types of pages available in the system.
PaginationWhere a page sits within the full result set.
PaginationResolvers
PaymentBrandTypeA way to pay the store accepts, which the site draws as that brand's logo.
ProductProduct entity containing all product information, variants, and metadata.
ProductCategoryRepresents a category of products.
ProductCategoryResolvers
ProductListProducts, either the variants the editor picked or those a source selects.
ProductListResolvers
ProductResolvers
ProductSortOrderTypeAvailable sorting options for product listings
ProductSourceWhich products a listing shows: those in a category, narrowed by facet selections, in a sort order.
ProductSourceFilterOne facet of a product source and the values it selects.
ProductSourceFilterResolvers
ProductSourceResolvers
ProductVariant
ProductVariantResolvers
PromoA card that links somewhere.
PromoListTwo to four promo cards side by side.
PromoListResolvers
PromoResolvers
QueryDefines the available queries in the schema.
QueryArticlesArgsDefines the available queries in the schema.
QueryCatalogPageArgsDefines the available queries in the schema.
QueryCatalogPageByFilterArgsDefines the available queries in the schema.
QueryContentPageArgsDefines the available queries in the schema.
QueryContentSearchArgsDefines the available queries in the schema.
QueryContentSnippetArgsDefines the available queries in the schema.
QueryMessagesArgsDefines the available queries in the schema.
QueryPageArgsDefines the available queries in the schema.
QueryPagesArgsDefines the available queries in the schema.
QueryRedirectArgsDefines the available queries in the schema.
QueryResolvers
QuerySiteArgsDefines the available queries in the schema.
QuerySiteSettingsArgsDefines the available queries in the schema.
ReferenceResolver
RequireFields
RequiresSessionDirectiveArgs
RequiresSessionDirectiveResolver
Resolver
ResolverFn
Resolvers
ResolversInterfaceTypesMapping of interface types
ResolversParentTypesMapping between all available schema types and the resolvers parents
ResolversTypesMapping between all available schema types and the resolvers types
ResolversUnionTypesMapping of union types
ResolverTypeWrapper
ResourceLinkRepresents a link to a resource, either internal or external.
ResourceLinkResolvers
ResourceLinkTypeSpecifies different types of resource links.
RichTextFormatted text, the same whichever CMS wrote it.
RichTextEmbedWhat rich text can embed.
RichTextEmbedResolvers
RichTextImageEmbedAn image placed in rich text.
RichTextImageEmbedResolvers
RichTextLinkA link in rich text, resolved by the adapter.
RichTextLinkResolvers
RichTextProductEmbedA product placed in rich text, by its sku.
RichTextProductEmbedResolvers
RichTextPromoEmbedA promo placed in rich text.
RichTextPromoEmbedResolvers
RichTextResolvers
RichTextShoppableImageEmbedA shoppable image placed in rich text.
RichTextShoppableImageEmbedResolvers
RichTextTipEmbedA tip placed in rich text.
RichTextTipEmbedResolvers
RichTextVideoEmbedA video placed in rich text.
RichTextVideoEmbedResolvers
ScalarsAll built-in and custom scalars, mapped to their actual values
SearchRedirectWhere a keyword rule sends a search instead of to a result page.
SearchRedirectResolvers
ShareableDirectiveArgs
ShareableDirectiveResolver
ShoppableImageOne image with two to six products pinned on it, also listed beside or below it.
ShoppableImageResolvers
SiteThe store's settings, one per store: its menus, the selling points in the header bar, its social profiles, payment brands and review rating, and the templates the SEO title and description of a page fall back to.
SiteResolvers
SiteSettingsWhich page of the site answers each recurring purpose, such as the contact or the returns page, one entry per store.
SiteSettingsResolvers
SocialLinkThe store's profile on a social network; the site draws the network's icon.
SocialLinkResolvers
SocialPlatformTypeA social network a store keeps a profile on.
StepOne step of a step list.
StepListTwo to four numbered steps, such as how an account, a return or a job works.
StepListResolvers
StepResolvers
StoreContentPreviewDataRepresents data for storing content previews.
StoreContentPreviewDataResolvers
StoreContentPreviewError
StoreContentPreviewErrorResolvers
StoreContentPreviewResponse
StoreContentPreviewResponseResolvers
StoreContext
StoreContextResolvers
StorefrontRouteTypeA page the storefront itself serves rather than the CMS.
SubscriptionObject
SubscriptionResolveFn
SubscriptionResolver
SubscriptionResolverObject
SubscriptionSubscribeFn
SubscriptionSubscriberObject
TableOfContentsLinks to the anchors on the page.
TableOfContentsResolvers
TimeScalarConfig
TipA highlighted tip, in a page body or inside rich text.
TipResolvers
TopicWhat an article is about, such as tennis or maintenance.
TopicPageA topic's page below a section of articles.
TopicPageResolvers
TopicResolvers
TranslatedPathRepresents a translated path for a specific locale.
TranslatedPathResolvers
TrustRatingThe store's average review score at a review service, such as 9.2 out of 10 from 1,284 reviews, as an editor entered it.
TrustRatingResolvers
TypeResolveFn
UrlScalarConfig
UspRepresents a single Unique Selling Point (USP).
UspIconTypeThe icon a selling point shows, from a fixed set the storefront maps to its own glyphs.
UspListThe store's selling points, two to six of them.
UspListResolvers
UspResolvers
ValidationErrorThe input was malformed: one or more fields need editing before the operation can succeed.
ValidationErrorResolvers
VideoA YouTube video, played from the privacy-enhanced domain once the visitor consents.
VideoResolvers
WithInternalFields
YoutubeVideoA YouTube video embedded in rich text.
YoutubeVideoResolvers

@evolve-framework/storyblok/sbtypes

TypeScript types of the Storyblok components the module reads.

Types

StoryblokArticleList
import { type StoryblokArticleList } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokArticleList {
title?: string;
articles?: (ISbStoryData<StoryblokArticlePage> | string)[];
section?: ISbStoryData<StoryblokArticleOverviewPage> | string;
category?: string;
limit?: number | string;
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "article_list";
_uid: string;
[k: string]: unknown;
}
StoryblokArticleOverviewPage
import { type StoryblokArticleOverviewPage } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokArticleOverviewPage {
heading: string;
intro?: string;
featured?: ISbStoryData<StoryblokArticlePage> | string;
body?: StoryblokContentPage["body"];
seoTitle?: string;
seoDescription?: string;
seoImage?: StoryblokAsset;
tabSeo?: unknown;
markets?: string[];
component: "article_overview_page";
_uid: string;
[k: string]: unknown;
}
StoryblokArticlePage
import { type StoryblokArticlePage } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokArticlePage {
title: string;
lead: string;
leadImage?: StoryblokAsset;
publishedAt?: string;
author?: ISbStoryData<StoryblokAuthor> | string;
topics?: (ISbStoryData<StoryblokTopic> | string)[];
categories?: string;
body?: StoryblokContentPage["body"];
related?: (ISbStoryData<StoryblokArticlePage> | string)[];
seoTitle?: string;
seoDescription?: string;
seoImage?: StoryblokAsset;
tabSeo?: unknown;
markets?: string[];
component: "article_page";
_uid: string;
[k: string]: unknown;
}
StoryblokAsset
import { type StoryblokAsset } from "@evolve-framework/storyblok/sbtypes";
interface StoryblokAsset {
alt: string | null;
copyright: string | null;
fieldtype: "asset";
id: number;
filename: string | null;
name: string;
title: string | null;
focus: string | null;
meta_data: Record<string, any>;
source: string | null;
is_external_url: boolean;
is_private: boolean;
src: string;
updated_at: string;
width: number | null;
height: number | null;
aspect_ratio: number | null;
public_id: string | null;
content_type: string;
}
StoryblokAuthor
import { type StoryblokAuthor } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokAuthor {
name?: string;
role?: string;
photo?: StoryblokAsset;
bio?: string;
tabContent?: unknown;
component: "author";
_uid: string;
[k: string]: unknown;
}
StoryblokBrandList
import { type StoryblokBrandList } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokBrandList {
title?: string;
brands: string;
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "brand_list";
_uid: string;
[k: string]: unknown;
}
StoryblokCampaignBanner
import { type StoryblokCampaignBanner } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokCampaignBanner {
title: string;
text?: string;
image: StoryblokAsset;
link: StoryblokLink[];
visibleUntil?: string;
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "campaign_banner";
_uid: string;
[k: string]: unknown;
}
StoryblokCatalogPage
import { type StoryblokCatalogPage } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokCatalogPage {
seoTitle?: string;
seoDescription?: string;
seoImage?: StoryblokAsset;
title: string;
category?: unknown;
facet_filters?: string;
description: string;
topContent?: (StoryblokArticleList | StoryblokBrandList | StoryblokColumns | StoryblokContentTeaser | StoryblokFaq | StoryblokFigureList | StoryblokProductList | StoryblokRichText | StoryblokShoppableImage | StoryblokStepList | StoryblokTableOfContents | StoryblokTip | StoryblokUspList)[];
bottomContent?: (StoryblokArticleList | StoryblokBrandList | StoryblokColumns | StoryblokContentTeaser | StoryblokFaq | StoryblokFigureList | StoryblokProductList | StoryblokRichText | StoryblokShoppableImage | StoryblokStepList | StoryblokTableOfContents | StoryblokTip | StoryblokUspList)[];
tabSeo?: unknown;
intro?: string;
promos?: StoryblokPromo[];
markets?: string[];
component: "catalog_page";
_uid: string;
[k: string]: unknown;
}
StoryblokCategoryList
import { type StoryblokCategoryList } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokCategoryList {
title?: string;
categories?: string;
parentCategory?: string;
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "category_list";
_uid: string;
[k: string]: unknown;
}
StoryblokColumns
import { type StoryblokColumns } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokColumns {
title?: string;
ratio?: "" | "equal" | "narrow_wide" | "wide_narrow";
items: (StoryblokFaq | StoryblokFigureList | StoryblokRichText | StoryblokShoppableImage)[];
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "columns";
_uid: string;
[k: string]: unknown;
}
StoryblokContentPage
import { type StoryblokContentPage } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokContentPage {
seoTitle?: string;
seoDescription?: string;
seoImage?: StoryblokAsset;
body?: (StoryblokArticleList | StoryblokBrandList | StoryblokColumns | StoryblokContentTeaser | StoryblokFaq | StoryblokFigureList | StoryblokProductList | StoryblokRichText | StoryblokShoppableImage | StoryblokStepList | StoryblokTableOfContents | StoryblokTip | StoryblokUspList)[];
tabSeo?: unknown;
categories?: string;
intro?: string;
leadImage?: StoryblokAsset;
headingVisible?: boolean;
markets?: string[];
component: "content_page";
_uid: string;
[k: string]: unknown;
}
StoryblokContentSnippet
import { type StoryblokContentSnippet } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokContentSnippet {
name: string;
key: string;
body: (StoryblokArticleList | StoryblokBrandList | StoryblokColumns | StoryblokContentTeaser | StoryblokFaq | StoryblokFigureList | StoryblokProductList | StoryblokRichText | StoryblokShoppableImage | StoryblokStepList | StoryblokTableOfContents | StoryblokTip | StoryblokUspList)[];
component: "content_snippet";
_uid: string;
[k: string]: unknown;
}
StoryblokContentTeaser
import { type StoryblokContentTeaser } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokContentTeaser {
title: string;
text?: StoryblokRichtext;
image?: StoryblokAsset;
links?: StoryblokLink[];
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "content_teaser";
_uid: string;
[k: string]: unknown;
}
StoryblokFaq
import { type StoryblokFaq } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokFaq {
title?: string;
items: StoryblokFaqItem[];
component: "faq";
_uid: string;
[k: string]: unknown;
}
StoryblokFaqItem
import { type StoryblokFaqItem } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokFaqItem {
question: string;
answer: StoryblokRichtext;
component: "faq_item";
_uid: string;
[k: string]: unknown;
}
StoryblokFigure
import { type StoryblokFigure } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokFigure {
value: string;
label: string;
source?: string;
component: "figure";
_uid: string;
[k: string]: unknown;
}
StoryblokFigureList
import { type StoryblokFigureList } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokFigureList {
title?: string;
figures: StoryblokFigure[];
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "figure_list";
_uid: string;
[k: string]: unknown;
}
StoryblokHotspot
import { type StoryblokHotspot } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokHotspot {
sku: string;
x: string | number;
y: string | number;
component: "hotspot";
_uid: string;
[k: string]: unknown;
}
StoryblokMenuItem
import { type StoryblokMenuItem } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokMenuItem {
label: string;
link: StoryblokLink[];
children?: StoryblokMenuItem[];
promo: StoryblokPromo[];
component: "menu_item";
_uid: string;
[k: string]: unknown;
}
StoryblokMessages
import { type StoryblokMessages } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokMessages {
cartEmpty?: StoryblokRichtext;
searchEmpty?: StoryblokRichtext;
notFound?: StoryblokRichtext;
component: "messages";
_uid: string;
[k: string]: unknown;
}
StoryblokMultiasset
import { type StoryblokMultiasset } from "@evolve-framework/storyblok/sbtypes";
interface StoryblokMultiasset extends Array<StoryblokAsset> {}
StoryblokNavigation
import { type StoryblokNavigation } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokNavigation {
name: string;
items: StoryblokMenuItem[];
component: "navigation";
_uid: string;
[k: string]: unknown;
}
StoryblokProduct
import { type StoryblokProduct } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokProduct {
sku: string;
component: "product";
_uid: string;
[k: string]: unknown;
}
StoryblokProductList
import { type StoryblokProductList } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokProductList {
title?: string;
skus?: string;
category?: string;
filters?: string;
sort?: "" | "popular" | "new" | "price_asc" | "price_desc";
limit?: string | number;
link: StoryblokLink[];
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "product_list";
_uid: string;
[k: string]: unknown;
}
StoryblokPromo
import { type StoryblokPromo } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokPromo {
title: string;
text?: string;
image?: StoryblokAsset;
link: StoryblokLink[];
component: "promo";
_uid: string;
[k: string]: unknown;
}
StoryblokPromoList
import { type StoryblokPromoList } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokPromoList {
title?: string;
promos: StoryblokPromo[];
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "promo_list";
_uid: string;
[k: string]: unknown;
}
StoryblokPropertyType
import { type StoryblokPropertyType } from "@evolve-framework/storyblok/sbtypes";
type StoryblokPropertyType = "asset" | "multiasset" | "multilink" | "table" | "richtext";
StoryblokRichtext
import { type StoryblokRichtext } from "@evolve-framework/storyblok/sbtypes";
interface StoryblokRichtext {
type: string;
content?: StoryblokRichtext[];
marks?: StoryblokRichtext[];
attrs?: Record<string, any>;
text?: string;
}
StoryblokRichText
import { type StoryblokRichText } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokRichText {
content: StoryblokRichtext;
component: "rich_text";
_uid: string;
[k: string]: unknown;
}
StoryblokShoppableImage
import { type StoryblokShoppableImage } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokShoppableImage {
title?: string;
image: StoryblokAsset;
hotspots: StoryblokHotspot[];
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "shoppable_image";
_uid: string;
[k: string]: unknown;
}
StoryblokSite
import { type StoryblokSite } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokSite {
headerNavigation?: string;
secondaryNavigation?: string;
footerNavigation?: string;
usps?: StoryblokUsp[];
socials?: StoryblokSocialLink[];
paymentMethods?: string[];
trustScore?: string;
trustMaxScore?: string;
trustReviewCount?: string;
trustUrl?: string;
catalogSeoTitle?: string;
catalogSeoDescription?: string;
articleSeoTitle?: string;
contentSeoTitle?: string;
topicPathSegment: string;
component: "site";
_uid: string;
[k: string]: unknown;
}
StoryblokSnippet
import { type StoryblokSnippet } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokSnippet {
snippet: ISbStoryData<StoryblokContentSnippet> | string;
component: "snippet";
_uid: string;
[k: string]: unknown;
}
StoryblokStep
import { type StoryblokStep } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokStep {
title: string;
text?: string;
link: StoryblokLink[];
component: "step";
_uid: string;
[k: string]: unknown;
}
StoryblokStepList
import { type StoryblokStepList } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokStepList {
title?: string;
steps: StoryblokStep[];
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "step_list";
_uid: string;
[k: string]: unknown;
}
StoryblokTable
import { type StoryblokTable } from "@evolve-framework/storyblok/sbtypes";
interface StoryblokTable {
fieldtype: "table";
thead: Array<{
_uid: string;
value: string;
component: "_table_head";
_editable?: string;
}>;
tbody: Array<{
_uid: string;
component: "_table_row";
_editable?: string;
body: Array<{
_uid: string;
value: string;
component: "_table_col";
_editable?: string;
}>;
}>;
}
StoryblokTableOfContents
import { type StoryblokTableOfContents } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokTableOfContents {
title?: string;
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "table_of_contents";
_uid: string;
[k: string]: unknown;
}
StoryblokTip
import { type StoryblokTip } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokTip {
label?: string;
text: string;
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "tip";
_uid: string;
[k: string]: unknown;
}
StoryblokTopic
import { type StoryblokTopic } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokTopic {
name?: string;
description?: string;
leadImage?: StoryblokAsset;
tabContent?: unknown;
component: "topic";
_uid: string;
[k: string]: unknown;
}
StoryblokUsp
import { type StoryblokUsp } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokUsp {
text: string;
description?: string;
icon?: string;
link: StoryblokLink[];
component: "usp";
_uid: string;
[k: string]: unknown;
}
StoryblokUspList
import { type StoryblokUspList } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokUspList {
usps: StoryblokUsp[];
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "usp_list";
_uid: string;
[k: string]: unknown;
}
StoryblokVideo
import { type StoryblokVideo } from "@evolve-framework/storyblok/sbtypes";
export interface StoryblokVideo {
youtubeId: string;
title: string;
anchor?: string;
audience?: "" | "everyone" | "logged_in" | "logged_out";
markets?: string[];
component: "video";
_uid: string;
[k: string]: unknown;
}

Not listed: 4 options types. They appear as the tables under the constructors and functions they type.