@spronta/sdk
v0.0.1
Published
Spronta CMS client SDK — fetch content from the Spronta platform or local files
Readme
@spronta/sdk
Client SDK for the Spronta CMS. Fetch content from the Spronta platform or local files.
Install
npm install @spronta/sdkQuick start
import { createClient } from "@spronta/sdk";
const client = createClient({
projectId: "your-project-id",
apiKey: "your-api-key",
});
// Fetch a page
const page = await client.getEntry("home");
// List entries by content model
const posts = await client.listEntries("blog-post");Modes
The SDK supports two data sources controlled by SPRONTA_SOURCE:
api(default) — fetches from the Spronta platform APIlocal— reads from local JSON files (for static site generation)
# .env
SPRONTA_SOURCE=localReact
import { SprontaContent } from "@spronta/sdk/react";
<SprontaContent entry={page} />