open-graph-types
v1.0.1
Published
📦️ Ultra-lightweight and strict Open Graph TypeScript definitions.
Maintainers
Readme
- node >= 22.17.0
- bun >= 1.1.0
<img src="./.github/asset/illustration/divider.svg" alt="divider" width="100%"" />
bun i -D open-graph-typesnpm i -D open-graph-typespnpm i -D open-graph-typesyarn i -D open-graph-typesimport { OpenGraph } from "open-graph-types";
const opg: OpenGraph = {
title: "Open Graph Types",
description: "Ultra-lightweight and strict Open Graph TypeScript definitions.",
url: "https://example.com",
type: "website",
image: {
url: "https://example.com/image.png",
width: 1200,
height: 630,
alt: "Open Graph Types",
},
};The OpenGraph type is a union of all the available Open Graph types, so you can use it to define any Open Graph metadata.
Other types are also available if you want to be more specific, such as OpenGraphBookType, OpenGraphMediaType, etc.
Here is the complete list of available types:
OpenGraph:OpenGraphTypeOpenGraphBookTypeOpenGraphMediaTypeOpenGraphArticleTypeOpenGraphProfileTypeOpenGraphVideoTypeOpenGraphMusicTypeOpenGraphLocaleTypeOpenGraphTwitterTypeOpenGraphDeterminerType
