@sopres/sdk
v1.0.21
Published
Official JavaScript/TypeScript SDK for soPres - Headless CMS Client
Maintainers
Readme
@sopres/sdk
TypeScript SDK for soPres CMS API.
Installation
npm install @sopres/sdkUsage
import { SopresClient } from "@sopres/sdk";
const client = new SopresClient({
baseUrl: "https://your-sopres-instance.com/api",
apiKey: "your-api-key",
});
// Fetch content
const pages = await client.content.list();
const page = await client.content.get("page-slug");
// Media
const media = await client.media.list();
// Patterns
const patterns = await client.patterns.list();API Reference
Content API
client.content.list()- List all contentclient.content.get(slug)- Get content by slugclient.content.create(data)- Create contentclient.content.update(id, data)- Update contentclient.content.delete(id)- Delete content
Media API
client.media.list()- List media filesclient.media.upload(file)- Upload fileclient.media.delete(id)- Delete file
Patterns API
client.patterns.list()- List patternsclient.patterns.get(id)- Get pattern
License
MIT
