@cosmocart/blog-sdk
v0.1.0
Published
Typed REST + realtime client for the cosmo-blog API.
Downloads
85
Readme
@cosmocart/blog-sdk
Typed REST + realtime client for the cosmo-blog API.
import { CosmoBlogClient } from '@cosmocart/blog-sdk'
const client = new CosmoBlogClient({
apiBaseUrl: 'https://cosmo-blog-api...run.app',
pkKey: 'pk_live_...', // public reads
// jwt: supabaseAccessToken, // owner reads/writes
})
const { items } = await client.listPublicPosts()
const post = await client.getPublicPostBySlug('hello-world')The package also exposes the useAutosave React hook used by the editor.
