Skip to content

renderOgImage

Renders a page’s card to a PNG.

Import:

import { renderOgImage } from '@mnaoumov/typescript-dev-toolkit/docs-site/og-image';

Signature:

function renderOgImage(params: OgCardContent, options: RenderOgImageOptions): Promise<Buffer<ArrayBufferLike>>

Parameters:

Parameter Type Description
params OgCardContent The card’s content.
options RenderOgImageOptions The fonts, logo and brand text every card shares.

Returns: Promise<Buffer<ArrayBufferLike>> — The PNG.