Skip to content

@scribe-atp/nuxt

nuxt.config.ts
export default defineNuxtConfig({
modules: ['@scribe-atp/nuxt'],
});

Once registered, useScribeSite and useScribeArticle are available in all components and pages without explicit imports.


function useScribeSite(
author: string,
siteSlug: string,
options?: AsyncDataOptions
): Promise<AsyncData<Site | null, Error | null>>

Wraps fetchSite with useAsyncData. The composable is SSR-safe: data is fetched on the server and hydrated on the client.

ParameterTypeDescription
authorstringAuthor handle or DID
siteSlugstringSite rkey — derive with toSlug(domain)
optionsAsyncDataOptionsOptional. Forwarded to useAsyncDatalazy, server, watch, etc.

Returns { data, pending, error, refresh } — the standard Nuxt AsyncData shape. data holds Site | null.


function useScribeArticle(
author: string,
articleSlug: string,
options?: AsyncDataOptions
): Promise<AsyncData<Article | null, Error | null>>

Wraps fetchArticle with useAsyncData.

ParameterTypeDescription
authorstringAuthor handle or DID
articleSlugstringArticle rkey / slug
optionsAsyncDataOptionsOptional. Forwarded to useAsyncData

Returns { data, pending, error, refresh }. data holds Article | null.


All types from @scribe-atp/core are re-exported:

import type { Site, Article, ArticleRef, SiteGroup } from '@scribe-atp/nuxt';

See the core reference for type definitions.