@xylabs/sdk-meta


Base functionality used throughout XYO TypeScript/JavaScript libraries
Reference
@xylabs/sdk-meta
Interfaces
Type Aliases
Functions
functions
getMetaAsDict
@xylabs/sdk-meta
function getMetaAsDict(obj, parentKey?): Record<string, string>;
Parameters
obj
StringIndexable
parentKey?
string
Returns
Record
<string
, string
>
mergeDocumentHead
@xylabs/sdk-meta
function mergeDocumentHead(destination, source): string;
Parameters
destination
string
source
string
Returns
string
metaBuilder
@xylabs/sdk-meta
function metaBuilder(
html,
meta,
handler?): string;
Parameters
html
string
meta
Meta
handler?
string
Returns
string
interfaces
Meta
@xylabs/sdk-meta
Properties
description?
optional description: string;
og?
optional og: OpenGraphMeta;
title?
optional title: string;
optional twitter: TwitterMeta;
OpenGraphMeta
@xylabs/sdk-meta
Properties
audio?
optional audio: OpenGraphStructuredProperty;
description?
optional description: string;
determiner?
optional determiner: string;
image?
optional image: OpenGraphStructuredProperty;
locale?
optional locale: string | string[];
site_name?
optional site_name: string;
title?
optional title: string;
type?
optional type: string;
url?
optional url: string;
video?
optional video: OpenGraphStructuredProperty;
OpenGraphStructured
@xylabs/sdk-meta
Properties
?
optional : string;
alt?
optional alt: string;
height?
optional height: number;
secure_url?
optional secure_url: string;
type?
optional type: string;
url?
optional url: string;
width?
optional width: number;
@xylabs/sdk-meta
Properties
id?
optional id: object;
googleplay?
optional googleplay: string;
ipad?
optional ipad: string;
iphone?
optional iphone: string;
name?
optional name: object;
googleplay?
optional googleplay: string;
ipad?
optional ipad: string;
iphone?
optional iphone: string;
url?
optional url: object;
googleplay?
optional googleplay: string;
ipad?
optional ipad: string;
iphone?
optional iphone: string;
@xylabs/sdk-meta
https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup
Properties
app?
optional app: TwitterApp;
card?
optional card: "summary" | "summary_large_image" | "app" | "player";
The card type. Used with all cards. Fallback: og:type.
If an og:type, og:title and og:description exist in the markup but
twitter:card is absent, then a summary card may be rendered.
creator?
optional creator: object;
?
optional : string;
The
Username
of content creator. Used with summary_large_image cards
id?
optional id: string;
Twitter user ID of content creator. Used with summary,
summary_large_image cards
description?
optional description: string;
Description of content (maximum 200 characters). Used with summary,
summary_large_image, player cards. Fallback: og:description.
image?
optional image: object;
?
optional : string;
URL of image to use in the card. Images must be less than 5MB in size.
JPG, PNG, WEBP and GIF formats are supported. Only the first frame of
an animated GIF will be used. SVG is not supported. Used with summary,
summary_large_image, player cards. Fallback: og:image
alt?
optional alt: string;
A text description of the image conveying the essential nature of
an image to users who are visually impaired. Maximum 420
characters. Used with summary, summary_large_image, player cards
player?
optional player: TwitterPlayer;
site?
optional site: object;
The
?
optional : string;
id?
optional id: string;
Same as twitter:site, but the user’s Twitter ID. Either
twitter:site or twitter:site:id is required. Used with
summary, summary_large_image, player cards
Username
of website. Either twitter:site or twitter:site:id is
required. Used with summary, summary_large_image, app, player
cards
title?
optional title: string;
Title of content (max 70 characters). Used with summary,
summary_large_image, player cards. Fallback: og:title.
@xylabs/sdk-meta
https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card
Properties
: string;
HTTPS URL to iFrame player. This must be a HTTPS URL which does not
generate active mixed content warnings in a web browser. The audio or
video player must not require plugins such as Adobe Flash.
height?
optional height: number;
Height of iframe in pixels. Used with player card
stream?
optional stream: string;
URL to raw video or audio stream. Used with player card
width?
optional width: number;
Width of iframe in pixels. Used with player card
type-aliases
OpenGraphStructuredProperty
@xylabs/sdk-meta
type OpenGraphStructuredProperty =
| string
| OpenGraphStructured
| (string | OpenGraphStructured)[];
StringIndexable
@xylabs/sdk-meta
type StringIndexable = object;
Index Signature
[key: string]: any
Part of sdk-js
Maintainers
License
See the LICENSE file for license details
Credits
Made with 🔥 and ❄️ by XYLabs