API reference
Framework-agnostic functions and types. Every other package is built on these. Install with npm install @skyscribe-sdk/core.
fetchPublicationfunction fetchPublication(
author: string,
publicationUrl: string,
signal?: AbortSignal
): Promise<StandardPublication>
Fetches a Publication from the author's PDS: resolves the author to a DID, finds their PDS, looks up the site.standard.publication record whose URL matches publicationUrl, and returns the StandardPublication with its Categories and DocumentRefs. Throws NotFoundError if no Publication matches.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle (alice.bsky.social) or DID (did:plc:…) |
publicationUrl | string | The Publication's canonical HTTPS URL, e.g. "https://alice.bsky.social" |
signal | AbortSignal | Optional. Cancel the request when the signal fires |
fetchDocumentBySlugfunction fetchDocumentBySlug(
author: string,
publicationUrl: string,
documentSlug: string,
signal?: AbortSignal
): Promise<StandardDocument>
Fetches a full Document by its slug. Fetches the Publication first, finds the DocumentRef with that slug, then fetches the Document from the account the ref points to (which can be a contributor's, not the Publication owner's). Throws NotFoundError if no published Document has that slug.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
publicationUrl | string | The Publication's canonical HTTPS URL, e.g. "https://alice.bsky.social" |
documentSlug | string | The Document's slug, as in its URL. (For very old Documents whose rkey was their slug, the rkey also matches.) |
signal | AbortSignal | Optional. Cancel the request when the signal fires |
The Document's uri is the full AT URI of its site.standard.document record: pass it to @skyscribe-sdk/social's buttons.
This is the function to use for Document pages, which usually have the slug from the URL.
fetchDocumentfunction fetchDocument(
author: string,
rkey: string,
signal?: AbortSignal
): Promise<StandardDocument>
Fetches a single Document, including its full HTML content, by its record key (rkey).
| Parameter | Type | Description |
|---|---|---|
author | string | Handle or DID of the account the Document is stored in |
rkey | string | The Document's record key. Get it from a DocumentRef with slugFromUri(ref.uri) |
signal | AbortSignal | Optional. Cancel the request when the signal fires |
Careful
Documents published with current tooling have opaque rkeys like 3mp47vvkh342n, so passing a human-readable slug only finds very old Documents. Use fetchDocumentBySlug when you have a slug. When you have a DocumentRef, take the account from its AT URI too (ref.uri.split('/')[2]), since a Document can live in a contributor's account.
fetchProfilefunction fetchProfile(
handleOrDid: string,
signal?: AbortSignal
): Promise<Profile>
Fetches a Bluesky profile (display name, avatar, bio and related data) for a handle or DID. It calls Bluesky's public app.bsky.actor.getProfile endpoint, which accepts either, so there's no PDS lookup.
| Parameter | Type | Description |
|---|---|---|
handleOrDid | string | Bluesky handle (alice.bsky.social) or DID (did:plc:…) |
signal | AbortSignal | Optional. Cancel the request when the signal fires |
Use it to show contributors, for example a byline card for each Writer contributor on a Document, falling back to the Publication owner's profile when there are none:
const writers = document.contributors?.filter((c) => c.role === "Writer") ?? [];
const profiles = writers.length > 0
? await Promise.all(writers.map((w) => fetchProfile(w.did, signal)))
: [await fetchProfile(SITE_AUTHOR, signal)];
resolvePublicationUrifunction resolvePublicationUri(
author: string,
publicationUrl: string,
signal?: AbortSignal
): Promise<string>
Returns the AT URI of the Publication record for the author and URL, without fetching the whole Publication. Results are cached in memory, so repeated calls with the same arguments make no further requests.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
publicationUrl | string | The Publication's canonical HTTPS URL |
signal | AbortSignal | Optional. Cancel the request when the signal fires |
Returns an AT URI, e.g. "at://did:plc:.../site.standard.publication/3mp4nd46xwr2h". Pass it to @skyscribe-sdk/social's buttons as publicationUri. (A fetched StandardPublication has the same value as publication.uri.)
withRetryfunction withRetry<T>(
fn: () => Promise<T>,
options?: {
attempts?: number;
delaysMs?: number[];
signal?: AbortSignal;
}
): Promise<T>
Retries a failing async call with backoff. It's generic: it wraps any of the fetch functions, or any other async function.
| Parameter | Type | Description |
|---|---|---|
fn | () => Promise<T> | The call to retry, e.g. () => fetchPublication(author, publicationUrl, signal) |
options.attempts | number | Total attempts including the first. Default 5 |
options.delaysMs | number[] | Delay in ms before each retry. Default [300, 600, 1200, 2400] |
options.signal | AbortSignal | Optional. Stops retrying immediately once aborted |
Never retries NotFoundError or an aborted signal. Retries everything else, including plain Errors. Nothing retries unless you use this: see Errors and retries for the full pattern.
listPublicationsfunction listPublications(
author: string,
signal?: AbortSignal
): Promise<StandardPublication[]>
Returns every Publication in the author's account, following pagination automatically. Records without a scribe object (made by other site.standard tools) are skipped.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle (alice.bsky.social) or DID (did:plc:…) |
signal | AbortSignal | Optional. Cancel the request when the signal fires |
listDocumentsfunction listDocuments(
author: string,
signal?: AbortSignal
): Promise<DocumentRef[]>
Returns every Document in the author's account, drafts included, as lightweight DocumentRef objects without content. Follows pagination automatically.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
signal | AbortSignal | Optional. Cancel the request when the signal fires |
Each ref's slug comes from the last segment of the Document's path; drafts, which have no path yet, get their rkey instead. coverImageUrl holds the Document's cover image. To fetch a Document's full content, pass its account and rkey (from ref.uri) to fetchDocument.
Note
Use this to list everything an author has written, drafts included. To list what's published on a website, use fetchPublication and its Categories, which have the author's ordering.
toSlugfunction toSlug(domain: string): string
Turns a domain name into a slug by replacing . with - and removing other characters that aren't lowercase letters, digits or hyphens.
toSlug('norobots.blog') // → "norobots-blog"
toSlug('anthonycregan.co.uk') // → "anthonycregan-co-uk"
No SDK function needs it any more: they all take the Publication's full URL. It's still exported for other uses.
slugFromUrifunction slugFromUri(uri: string): string
Returns the last segment of an AT URI: the record key (rkey). Despite the name, for current Documents that's an opaque TID, not the human-readable slug.
slugFromUri('at://did:plc:abc/site.standard.document/3mp47vvkh342n') // → "3mp47vvkh342n"
flattenDocumentsfunction flattenDocuments(
categories: Array<{ documents: DocumentRef[] }>
): DocumentRef[]
Flattens the DocumentRefs from all Categories into one array, in Category order.
const allDocuments = flattenDocuments(publication.categories);
generateFeedfunction generateFeed(publication: StandardPublication, options: FeedOptions): string
Returns a complete RSS 2.0 XML string for the Publication's published Documents, in Category order.
FeedOptions
| Property | Type | Required | Description |
|---|---|---|---|
baseUrl | string | Yes | Your website's origin, e.g. "https://alice.example.com" |
feedUrl | string | No | The feed's own URL, used for the <atom:link rel="self"> |
language | string | No | RSS <language> tag. Default: "en" |
limit | number | No | Maximum number of items to include |
See the RSS feeds guide for usage examples.
getSitemapEntriesfunction getSitemapEntries(
publication: StandardPublication,
options: GetSitemapEntriesOptions
): SitemapEntry[]
Returns sitemap entries for the home page, the base path root (if any), each Category page and each published Document. Documents marked canonicalElsewhere are left out: their canonical URL is the original's, on another website. So are Documents marked noindex.
GetSitemapEntriesOptions
| Property | Type | Required | Description |
|---|---|---|---|
baseUrl | string | Yes | Your website's origin, e.g. "https://alice.example.com" |
SitemapEntry
interface SitemapEntry {
url: string;
lastmod?: string; // date only, e.g. "2024-03-15" (documents only, from updatedAt)
}
See the Sitemaps guide for usage examples.
generateDocumentMetafunction generateDocumentMeta(document: StandardDocument, publication: StandardPublication): ScribeMetaTag[]
Returns a framework-neutral array of tag descriptors for a Document page: the <title>, a canonical <link>, the site.standard link tags, description, og:type, og:title, og:url, og:site_name, og:description, og:image (the cover image), twitter:card, twitter:title, twitter:description, twitter:image, and JSON-LD structured data. The Document's SEO Settings replace the title and description tags (not the JSON-LD headline) and add robots: noindex when set.
| Parameter | Type | Description |
|---|---|---|
document | StandardDocument | The full Document, as returned by fetchDocumentBySlug or fetchDocument |
publication | StandardPublication | The Publication, used for og:site_name, the title, the link tags and the publisher in the JSON-LD |
The framework packages have their own equivalents in their framework's format (documentMeta in @skyscribe-sdk/react-router-framework, documentMetadata in @skyscribe-sdk/next, documentSeoMeta in @skyscribe-sdk/nuxt). Use this one directly for other frameworks, converting each descriptor to your framework's format.
The structured data comes as a { "script:ld+json": ... } descriptor built with generateDocumentJsonLd, so you don't need to call that yourself unless your framework's metadata API has no room for a <script> tag (see below).
See the meta tags guide for framework-specific usage.
generatePublicationMetafunction generatePublicationMeta(publication: StandardPublication): ScribeMetaTag[]
Returns tag descriptors for a Publication's home or Category pages: the title, a canonical <link>, the site.standard.publication link tag, og:type (website), og:title, og:url, og:site_name and Twitter Card tags, plus the description and splash image when set, and JSON-LD structured data from generatePublicationJsonLd.
| Parameter | Type | Description |
|---|---|---|
publication | StandardPublication | The Publication |
standardSiteLinksfunction standardSiteLinks(
publication: StandardPublication,
document?: StandardDocument
): StandardSiteLink[]
type StandardSiteLink = { tagName: "link"; rel: string; href: string };
Returns just the <link rel="site.standard.publication"> tag, plus <link rel="site.standard.document"> when given a Document. Bluesky needs them, server-rendered, to show its Standard.site link card. The two meta helpers above include them already; use this on pages that don't use those (Category pages, custom heads). See site.standard link tags.
buildCanonicalUrlfunction buildCanonicalUrl(document: StandardDocument, publication: StandardPublication): string
Returns a Document's full canonical URL: the canonicalUrl SkyScribe stored when the Document was published. For very old records without one, it builds it from publication.domain and document.path, adding publication.basePath only if the path doesn't already start with it.
buildCanonicalUrl(document, publication);
// → "https://alice.bsky.social/blog/essays/my-first-post"
buildPublicationUrlfunction buildPublicationUrl(publication: StandardPublication): string
Returns the full URL of a Publication's home page, from publication.domain and publication.basePath.
| Parameter | Type | Description |
|---|---|---|
publication | StandardPublication | The Publication |
buildPublicationUrl(publication);
// → "https://alice.bsky.social/blog"
generateDocumentJsonLdfunction generateDocumentJsonLd(document: StandardDocument, publication: StandardPublication): JsonLdObject
Returns a schema.org BlogPosting as a plain, JSON-serialisable object: headline, publish and modified dates, author (the first contributor's name, or the Publication's name), publisher, and the description, cover image and keywords when present. generateDocumentMeta already includes it, so you rarely need to call it directly.
| Parameter | Type | Description |
|---|---|---|
document | StandardDocument | The full Document |
publication | StandardPublication | The Publication |
Call it directly when your framework's metadata API has no place for a <script> tag, so you render <script type="application/ld+json"> yourself. Next.js's Metadata object is one example (@skyscribe-sdk/next re-exports it):
import { generateDocumentJsonLd } from '@skyscribe-sdk/core';
// in your page component
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(generateDocumentJsonLd(document, publication)) }}
/>
generatePublicationJsonLdfunction generatePublicationJsonLd(publication: StandardPublication): JsonLdObject
Returns a schema.org WebSite object: name, URL, and the description if present. generatePublicationMeta already includes it; call it directly for the same reason as generateDocumentJsonLd above.
| Parameter | Type | Description |
|---|---|---|
publication | StandardPublication | The Publication |
Every function above only reads, and needs no login. crossPostToBluesky is the one exception: it writes a record, so it needs an authenticated agent.
crossPostToBlueskyfunction crossPostToBluesky(
agent: AtpAgentLike,
params: CrossPostParams
): Promise<StrongRef>
Creates a Bluesky post (app.bsky.feed.post) with a link card pointing at the Document, plus associatedRefs linking the post back to its site.standard.document and site.standard.publication records. The result is what goes in a Document's bskyPostRef.
| Parameter | Type | Description |
|---|---|---|
agent | AtpAgentLike | An authenticated AT Protocol agent with com.atproto.repo.createRecord, e.g. an @atproto/api Agent with an OAuth session for the author's own account |
params | CrossPostParams | See below |
Returns a StrongRef ({ uri, cid }) for the new post. Write it to the Document's bskyPostRef field yourself, so websites can link to the post.
This is a low-level building block for your own publishing tool. SkyScribe does the same thing when an author uses Share to Bluesky, so websites that only display content never need it. The document and publication URIs and CIDs come from your tool's own createRecord / getRecord responses: the SDK's StandardDocument and StandardPublication types don't carry CIDs.
import { crossPostToBluesky, buildCanonicalUrl } from '@skyscribe-sdk/core';
const ref = await crossPostToBluesky(agent, {
did: authorDid,
documentUri,
documentCid,
publicationUri,
publicationCid,
canonicalUrl: buildCanonicalUrl(document, publication),
title: document.title,
text: `New post: ${document.title}`,
description: document.description,
});
// ref → { uri: "at://did:plc:.../app.bsky.feed.post/3mp...", cid: "..." }
An Embed is a video, a piece of music, a code pen, a Bluesky post or a link card in a Document. SkyScribe stores each one in the Document's HTML as a working link, marked with its kind:
<figure data-embed="youtube">
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">Never Gonna Give You Up</a>
</figure>
Rendered as it is, that's a link. To show the player, run the HTML through renderEmbeds, and call enhanceEmbeds once in the browser. ScribeContent does both for you.
renderEmbedsfunction renderEmbeds(html: string, options?: { clickToLoad?: boolean }): string
Returns the HTML with every Embed ready to show:
enhanceEmbeds then swaps the Poster for the player, already playing where the provider allows it. A Poster is a link to the media's page, so without the script a click opens it there.scribe-embed classes; @skyscribe-sdk/styles draws them as cards.Pass { clickToLoad: false } to load every player with the page instead of Posters: lazy-loading, full-width iframes. Everything else in the HTML is returned unchanged.
The stored HTML is never trusted to say what to load. Each kind has a strict pattern for its link, and the player's address is built only from the parts that match, both here and when a Poster is clicked. An Embed whose link doesn't match, or whose kind this version doesn't know, is left as its link.
| Kind | data-embed | Player | Poster button |
|---|---|---|---|
| Link card | link | The stored card | None |
| Bluesky post | bluesky | Bluesky's official embed, from the post's at:// URI in data-embed-ref | None: always the player |
| YouTube | youtube | youtube-nocookie.com, keeping a start time | Play |
| Spotify | spotify | Track, album, playlist, episode, show or artist | Load player |
| Bandcamp | bandcamp | From the album or track number in data-embed-ref | Load player |
| Vimeo | vimeo | With Do Not Track on | Play |
| CodePen | codepen | The pen's result | Load player |
| SoundCloud | soundcloud | Track or playlist | Play |
A Poster's thumbnail is the first https: image in the stored link; a YouTube Embed without one uses the video's own thumbnail. Kinds with no thumbnail show a plain tile.
It's a pure string function, so it runs anywhere: on the server, in a Worker or in the browser. Frameworks without a ScribeContent component call it themselves, and call enhanceEmbeds once the HTML is on the page:
<script setup lang="ts">
import { onMounted, onUnmounted } from "vue";
import { enhanceEmbeds, renderEmbeds } from "@skyscribe-sdk/core";
const props = defineProps<{ html: string }>();
let stop = () => {};
onMounted(() => (stop = enhanceEmbeds(window)));
onUnmounted(() => stop());
</script>
<template>
<div class="scribe-content" v-html="renderEmbeds(props.html)" />
</template>
enhanceEmbedsfunction enhanceEmbeds(target: Window): () => void
Everything a page with Embeds needs in the browser: Posters load their player when clicked, and Bluesky posts grow to their real height. Call it once; it returns a function that stops both. It listens on the document, so Embeds added to the page later work too. ScribeContent calls it for you.
A click on a Poster swaps it for the player, rebuilt from the Embed's kind and link (never from anything else on the page), and moves focus into it. A click with a modifier key, to open the link in a new tab, is left to the browser.
useEffect(() => enhanceEmbeds(window), []);
listenForEmbedClicks(window) and listenForEmbedResize(window) are the two halves, if you only want one. Without listenForEmbedResize, a Bluesky Embed stays 400px tall.
hasEmbedPlayerfunction hasEmbedPlayer(html: string): boolean
Whether a stored Embed (its <figure data-embed> HTML) shows a player: true for a known media kind or Bluesky post whose link matches its pattern, false for a link card or anything renderEmbeds would leave as its link. Useful when creating Embeds, to warn that a link will only show as a link.
EMBED_KINDS and EMBED_FRAME_HOSTSconst EMBED_KINDS: readonly EmbedKind[];
const EMBED_FRAME_HOSTS: readonly string[];
EMBED_KINDS lists the kinds above. EMBED_FRAME_HOSTS lists the hosts players load from. If your site sends a Content-Security-Policy, add them to its frame-src, and allow https: images for Posters' thumbnails:
const csp = `frame-src ${EMBED_FRAME_HOSTS.join(" ")}; img-src 'self' https:`;
The beacon behind Site Analytics. The framework packages wrap these; use them directly on other stacks.
loadSiteAnalyticsfunction loadSiteAnalytics(doc?: SiteAnalyticsDocument): void
Adds the beacon <script> to the page's <head>, once. Calling it again, or on a page that already has the tag from siteAnalyticsScriptTag(), does nothing. Call it in the browser: without a document (on the server) it does nothing.
siteAnalyticsScriptTagfunction siteAnalyticsScriptTag(): string
The beacon as an HTML <script> tag, to print into a server-rendered template before </body>.
siteAnalyticsScriptfunction siteAnalyticsScript(): SiteAnalyticsScript
interface SiteAnalyticsScript {
src: string;
attributes: { defer: true; "data-cf-beacon": string; "data-skyscribe-analytics": "" };
}
The beacon as data, for frameworks that build head tags from objects. SITE_ANALYTICS_SCRIPT_SRC is its src.
NotFoundErrorclass NotFoundError extends Error {}
Thrown when the request worked but the Publication or Document doesn't exist. Retrying won't help: treat it like an HTTP 404.
PdsFetchErrorclass PdsFetchError extends Error {
constructor(message: string, options?: { cause?: unknown });
}
Thrown when the PDS responded with an error status. The service is up; this operation failed. Safe to retry: see withRetry and Errors and retries.
PdsUnreachableErrorclass PdsUnreachableError extends PdsFetchError {
constructor(message: string, options?: { cause?: unknown });
}
Thrown when a request never got a response: DNS failure, connection refused, timeout. It extends PdsFetchError, so instanceof PdsFetchError matches it too; check instanceof PdsUnreachableError first if your UI tells "this record had trouble loading" apart from "the service is down". Safe to retry.
StandardPublicationA site.standard.publication record.
interface StandardPublication {
uri: string; // AT URI of the publication record
name: string; // The spec's name
domain: string; // Bare domain, no protocol, e.g. "alice.bsky.social"
basePath: string; // Path prefix, e.g. "blog", or "" if Documents are at the root
description?: string;
splashImageUrl?: string;
logoImageUrl?: string;
categories: Category[];
}
CategoryA named, ordered set of Documents within a Publication. A SkyScribe extension: the spec has no equivalent.
interface Category {
slug: string;
title: string;
documents: DocumentRef[];
}
DocumentRefA lightweight snapshot of a Document, stored in its Publication's record so you can list Documents without fetching each one. Doesn't include content.
interface DocumentRef {
uri: string; // AT URI, e.g. "at://did:plc:…/site.standard.document/3mp47vvkh342n"
title: string;
slug?: string; // Human-readable slug, as in the Document's URL
coverImageUrl: string | null;
description?: string | null;
tags?: string[];
contributors?: DocumentContributor[];
createdAt: string; // ISO 8601
publishedAt?: string; // ISO 8601
updatedAt?: string; // ISO 8601
canonicalElsewhere?: true; // Canonical URL is another website's; see below
noindex?: true; // The author asked search engines to leave it out
}
canonicalElsewhere is set on a Document that was imported into SkyScribe from another app (Leaflet, pckt, …) when its author chose to keep the original as the canonical URL. Your copy still renders as normal, but search engines should index the original: getSitemapEntries leaves these Documents out.
noindex is set when the Document's author turned on noindex in its SEO Settings. getSitemapEntries leaves it out too; it still belongs on your website and in your feed.
StandardDocumentA site.standard.document record: the full Document, including its HTML content. Returned by fetchDocument and fetchDocumentBySlug.
interface StandardDocument {
uri: string; // AT URI of the document record
title: string;
content: string; // HTML, as stored. Sanitise it if you render accounts you don't control
textContent?: string; // Plain-text version of content (HTML tags stripped)
path: string; // e.g. "/blog/creative-writing/my-post"
site: string; // The spec's field: AT URI of the publication, e.g. "at://did:plc:…/site.standard.publication/3abc"
canonicalUrl?: string; // Fully-qualified URL, e.g. "https://myblog.com/blog/creative-writing/my-post"
coverImageUrl?: string; // URL of the cover image
description?: string;
tags?: string[];
contributors?: DocumentContributor[];
bskyPostRef?: { uri: string; cid: string }; // set if the Document was shared to Bluesky
seo?: DocumentSeo; // The author's SEO Settings; absent when none are set
createdAt?: string; // ISO 8601
publishedAt: string; // ISO 8601
updatedAt: string; // ISO 8601
}
DocumentSeoA Document's SEO Settings, as document.seo. Only valid values are kept: a field over its limit (SEO_TITLE_MAX = 200, SEO_DESCRIPTION_MAX = 500 characters) or of the wrong type is dropped. readDocumentSeo(raw) does the same for a raw record's scribe.seo.
interface DocumentSeo {
title?: string; // Replaces the title in <title>, og:title and twitter:title
description?: string; // Replaces the description in the description tags
noindex?: true; // Ask search engines to leave the document out
}
DocumentContributorPeople credited on a Document's byline, such as a co-writer, editor or illustrator, added by the author. SkyScribe calls them Contributors. They're not the same as SkyScribe's Collaborators, who are people invited to work on a Publication.
interface DocumentContributor {
did: string; // AT Protocol DID of the contributor
role?: string; // e.g. "author", "editor", "illustrator"
displayName?: string; // Human-readable name
}
ProfileReturned by fetchProfile. Mirrors Bluesky's app.bsky.actor.defs#profileViewDetailed shape.
interface Profile {
did: string;
handle: string;
displayName?: string;
description?: string;
avatar?: string;
banner?: string;
pronouns?: string;
website?: string;
followersCount?: number;
followsCount?: number;
postsCount?: number;
createdAt?: string; // ISO 8601
associated?: ProfileAssociated;
pinnedPost?: { uri: string; cid: string };
verification?: ProfileVerification;
status?: ProfileStatus;
}
ProfileAssociatedinterface ProfileAssociated {
lists?: number;
feedgens?: number;
starterPacks?: number;
labeler?: boolean;
}
ProfileVerificationinterface ProfileVerification {
verifiedStatus: string;
trustedVerifierStatus: string;
verifications: Array<{
issuer: string;
uri: string;
isValid: boolean;
createdAt: string;
}>;
}
ProfileStatusinterface ProfileStatus {
status: string;
expiresAt?: string;
isActive?: boolean;
isDisabled?: boolean;
}
ScribeMetaTagThe element type of generateDocumentMeta and generatePublicationMeta's output. One of five shapes:
type ScribeMetaTag =
| { title: string }
| { name: string; content: string }
| { property: string; content: string }
| { tagName: "link"; rel: string; href: string }
| { "script:ld+json": JsonLdObject };
You only handle it directly for frameworks without an SDK package. The link shape covers the canonical link and the site.standard link tags. The script:ld+json shape carries the structured data from generateDocumentJsonLd.
JsonLdObjectA plain, JSON-serialisable object, compatible with frameworks' own JSON-LD types (such as React Router's LdJsonObject).
type JsonLdObject = {
[key: string]: string | number | boolean | null | JsonLdObject | JsonLdObject[];
};
CrossPostParamsInput to crossPostToBluesky.
interface CrossPostParams {
did: string; // The author's own DID: the account the post is written to
documentUri: string; // AT URI of the site.standard.document being cross-posted
documentCid: string;
publicationUri: string; // AT URI of the owning site.standard.publication
publicationCid: string;
canonicalUrl: string; // The document's canonical URL: the link card's target
title: string;
text: string; // The post's own text content
description?: string;
thumbBlob?: unknown; // A pre-uploaded blob ref for the link-card thumbnail, if any
}
StrongRefAn AT Protocol reference to one specific version of a record: its URI plus the CID of that version. Returned by crossPostToBluesky, and the shape of StandardDocument.bskyPostRef.
interface StrongRef {
uri: string;
cid: string;
}
The 4.x names still work, marked @deprecated, until the next major: fetchSite, fetchArticle, fetchArticleBySlug (still returning { article, uri }), listSites, listArticles, flattenArticles, generateSiteMeta, generateArticleMeta, generateSiteJsonLd, generateArticleJsonLd, buildSiteUrl, and the types Site, Article, SiteGroup, ArticleRef, ArticleContributor and ArticleResult. See Upgrading to 5.0.