@youversion/tabernacle-sdk
v0.1.0
Published
TypeScript SDK for Tabernacle API
Readme
Tabernacle TypeScript SDK
TypeScript SDK for interacting with the Tabernacle API.
Installation
npm install @yv/tabernacle-sdk
# or
pnpm add @yv/tabernacle-sdkUsage
import {
configure,
contentList,
contentGet,
contentCreate,
VideoData,
ReadingPlanData,
} from "@yv/tabernacle-sdk";
// Configure the SDK
configure({
baseUrl: "https://your-cms.example.com/api/v1",
apiKey: "yvcms_your_api_key_here",
});
// List content
const result = await contentList({ query: { typeSlug: "video" } });
const videos = result.data.items as VideoData[];
videos.forEach((v) => console.log(v.title, v.duration));
// Get single content item
const plan = await contentGet({ path: { id: "uuid-here" } });
const planData = plan.data as ReadingPlanData;
console.log(planData.title);
// Create content
await contentCreate({
body: {
typeSlug: "video",
data: {
title: "Sunday Service",
slug: "sunday-service-2025-01",
sourceUrl: "https://...",
duration: 3600,
orientation: "landscape",
language: "en",
},
},
});
// Update content
await contentUpdate({
path: { id: "uuid-here" },
body: {
id: "uuid-here",
data: { title: "Updated Title" },
changeSummary: "Fixed typo in title",
},
});Type Safety
All content type schemas are available as TypeScript types:
import { VideoData, ReadingPlanData } from "@yv/tabernacle-sdk";
// Full autocomplete and type checking
const video: VideoData = {
title: "My Video",
slug: "my-video",
sourceUrl: "https://...",
duration: 120,
orientation: "landscape",
language: "en",
renditions: [],
previewRenditions: [],
captions: [],
};