Skip to content

types.ts#

View Markdown

Source

9 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

9 symbols 5 interfaces 3 types 1 modules 1 parameters 28 members 1 returns

Reference#

interfaceOgImageOptionsOG image generation options (user-facing).

OG image generation options (user-facing).

Signature

export interface OgImageOptions

View source

Members

Properties
NameTypeDescription
cacheoptional boolean
Enable content-hash based caching.
Skips rendering when content hasn't changed.
Default true
concurrencyoptional number
Number of concurrent page instances for parallel rendering.
Default 1
heightoptional number
Image height in pixels.
Default 630
rendereroptional OgImageRenderer
Rendering backend.
- "chromium": full browser rendering, best template compatibility
- "satori": fast HTML-to-SVG-to-PNG rendering, limited CSS subset
Default "chromium"
satorioptional OgImageSatoriOptions
Options for the Satori renderer.
templateoptional string
Path to a custom template file (.ts, .vue, .svelte, .tsx/.jsx).
- .ts: default-export a function (props) => string
- .vue: Vue SFC, rendered via SSR
- .svelte: Svelte SFC, rendered via SSR
- .tsx/.jsx: React Server Component, rendered via SSR
If not specified, the built-in default template is used.
vuePluginoptional "vitejs" | "vizejs"
Vue plugin to use for compiling .vue templates.
- 'vitejs': Use @vue/compiler-sfc (official, default)
- 'vizejs': Use @vizejs/vite-plugin (Rust-based)
Default 'vitejs'
widthoptional number
Image width in pixels.
Default 1200
typeOgImageRenderer = "chromium" | "satori"OG image rendering backend.

OG image rendering backend.

Signature

export type OgImageRenderer = "chromium" | "satori"

View source

interfaceOgImageSatoriFontFont file loaded by the Satori renderer.

Font file loaded by the Satori renderer.

Signature

export interface OgImageSatoriFont

View source

Members

Properties
NameTypeDescription
nameoptional string
Font family name used by template CSS.
path string
Absolute path, or a path relative to the project root.
styleoptional "normal" | "italic"
Font style.
Default "normal"
weightoptional OgImageSatoriFontWeight
Font weight.
Default 400
typeOgImageSatoriFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900Font weight values supported by Satori.

Font weight values supported by Satori.

Signature

export type OgImageSatoriFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900

View source

interfaceOgImageSatoriOptionsSatori renderer options.

Satori renderer options.

Signature

export interface OgImageSatoriOptions

View source

Members

Properties
NameTypeDescription
fontsoptional OgImageSatoriFont[]
Font files passed to Satori.

Satori cannot render text without at least one font. When omitted,
Ox Content tries a small set of system font paths unless
systemFontFallback is disabled.
systemFontFallbackoptional boolean
Try known OS font paths when fonts is empty.
Default true
typeOgImageTemplateFn = (props: OgImageTemplateProps) => string | Promise<string>Template function that receives page metadata and returns an HTML string.

Template function that receives page metadata and returns an HTML string.

Signature

export type OgImageTemplateFn = (props: OgImageTemplateProps) => string | Promise<string>

View source

Parameters

Returns

string | Promise<string>
interfaceOgImageTemplatePropsProps passed to OG image template functions.

Props passed to OG image template functions.

Signature

export interface OgImageTemplateProps

View source

Members

Indexable
[key: string]: unknown
Custom data from frontmatter (arbitrary key-value pairs)
Properties
NameTypeDescription
authoroptional string
Author name
descriptionoptional string
Page description
siteNameoptional string
Site name
tagsoptional string[]
Tags/categories
title string
Page title
interfaceResolvedOgImageOptionsResolved OG image options with all defaults applied.

Resolved OG image options with all defaults applied.

Signature

export interface ResolvedOgImageOptions

View source

Members

Properties
NameTypeDescription
cache boolean
concurrency number
height number
renderer OgImageRenderer
satori { fonts: OgImageSatoriFont[]; systemFontFallback: boolean }
templateoptional string
vuePlugin "vitejs" | "vizejs"
width number
moduletypesType definitions for OG image generation.

Type definitions for OG image generation.

View source