API reference
@scribe-atp/vue
Composables
useScribeSite
function useScribeSite(author: string, publicationUrl: string): UseScribeSiteResult
interface UseScribeSiteResult {
site: Ref<Site | null>;
loading: Ref<boolean>;
error: Ref<Error | null>;
}
Fetches a site when the composable is called and aborts the request when the host component is unmounted. Returns reactive refs.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
publicationUrl | string | The site's canonical HTTPS URL, e.g. "https://alice.bsky.social" |
While loading, site.value is null and loading.value is true. On error, error.value is set. AbortError is swallowed.
useScribeArticle
function useScribeArticle(author: string, articleSlug: string): UseScribeArticleResult
interface UseScribeArticleResult {
article: Ref<Article | null>;
loading: Ref<boolean>;
error: Ref<Error | null>;
}
Fetches an article when the composable is called and aborts on unmount. Returns reactive refs.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
articleSlug | string | Article rkey / slug |
useScribePublicationUri
function useScribePublicationUri(
author: string,
publicationUrl: string
): UseScribePublicationUriResult
interface UseScribePublicationUriResult {
uri: Ref<string | null>;
loading: Ref<boolean>;
error: Ref<Error | null>;
}
Resolves just the AT URI of a site record — wraps resolvePublicationUri from @scribe-atp/core — without fetching the full Site object. Aborts on unmount.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
publicationUrl | string | The site's canonical HTTPS URL |
Use this when all you need is the AT URI to pass to @scribe-atp/social's SubscribeButton, and fetching (and reacting to) the full site object would be wasted work.
useScribeDocumentUri
function useScribeDocumentUri(
author: string,
publicationUrl: string,
articleSlug: string
): UseScribeDocumentUriResult
interface UseScribeDocumentUriResult {
uri: Ref<string | null>;
loading: Ref<boolean>;
error: Ref<Error | null>;
}
Resolves just the AT URI of an article record — internally calls fetchArticleBySlug from @scribe-atp/core and keeps only the uri, discarding the article body. Aborts on unmount.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
publicationUrl | string | The site's canonical HTTPS URL |
articleSlug | string | Article rkey / slug |
Use this when all you need is the AT URI to pass to @scribe-atp/social's LikeButton or ShareButton, typically alongside useScribeArticle when you're already rendering the full article elsewhere and don't want a second full fetch just for the URI.
Types
All types from @scribe-atp/core are re-exported:
import type { Site, Article, ArticleRef, SiteGroup } from '@scribe-atp/vue';
See the core reference for type definitions.