Skip to content

b10cks/sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

b10cks SDK

Official JavaScript/TypeScript SDKs for b10cks – a modern headless CMS and content management platform.

This monorepo contains multiple packages that enable seamless integration of b10cks into your web applications.

πŸ“¦ Packages

Framework-agnostic core for communicating with the b10cks Data API.

  • Type-safe HTTP client
  • Shared B10cksDataApi abstraction
  • Automatic pagination handling
  • Revision and version tracking
  • Works in browsers and Node.js
npm install @b10cks/client

Vue 3 integration for building interactive content management experiences.

  • Vue 3 plugin with global directives
  • Data composables built on @b10cks/client
  • Editable content directives (v-editable, v-editable-field)
  • Reusable component system
  • Preview bridge support
npm install @b10cks/vue @b10cks/client

Nuxt 4 module for zero-config integration with Nuxt applications.

  • Auto-configured b10cks integration
  • Shared composables via @b10cks/vue
  • Runtime configuration
  • Built on top of @b10cks/vue
npm install @b10cks/nuxt

React integration with provider, hooks, and block rendering.

  • B10cksProvider context for client/data API
  • Typed hooks (useB10cksApi)
  • Preview bridge integration
npm install @b10cks/react @b10cks/client

Svelte integration with context, stores, and actions.

  • Svelte context setup (createB10cksContext)
  • Typed async stores (createB10cksStores)
  • editable and editableField actions
npm install @b10cks/svelte @b10cks/client

Next.js integration layer on top of the React SDK.

  • Next-friendly provider (B10cksNextProvider)
  • Server helper (createB10cksNextApi)
  • Config helper (withB10cks)
npm install @b10cks/next @b10cks/react @b10cks/client

πŸš€ Quick Start

For Nuxt Projects

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@b10cks/nuxt'],
  b10cks: {
    accessToken: 'your-access-token',
    apiUrl: 'https://api.b10cks.com/api',
  },
})

For Vue Projects

import { createApp } from 'vue'
import { B10cksVue } from '@b10cks/vue'

const app = createApp(App)

app.use(B10cksVue, {
  apiClientOptions: {
    token: 'your-access-token',
    baseUrl: 'https://api.b10cks.com/api',
  },
})

app.mount('#app')

For Direct API Access

import { ApiClient } from '@b10cks/client'
import { createB10cksDataApi } from '@b10cks/client'

const client = new ApiClient(
  {
    baseUrl: 'https://api.b10cks.com/api',
    token: 'your-access-token',
    fetchClient: fetch,
  },
  new URL(window.location.href)
)

const dataApi = createB10cksDataApi(client)
const blocks = await dataApi.getBlocks()

πŸ“– Documentation

πŸ› οΈ Development

Prerequisites

  • Node.js 24.7.0 or higher
  • pnpm 10.15.1 or higher

Setup

# Install dependencies
pnpm install

# Build all packages
pnpm run build

# Run tests
pnpm run test

# Lint and fix code
pnpm run lint:fix

Project Structure

sdk/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ client/       # Core API client
β”‚   β”œβ”€β”€ vue/          # Vue 3 plugin
β”‚   β”œβ”€β”€ react/        # React SDK
β”‚   β”œβ”€β”€ svelte/       # Svelte SDK
β”‚   β”œβ”€β”€ nuxt/         # Nuxt module
β”‚   └── next/         # Next.js integration
β”œβ”€β”€ scripts/          # Build and utility scripts
└── .changeset/       # Changesets for versioning

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines on:

  • Setting up your development environment
  • Making code changes
  • Writing tests
  • Submitting pull requests

πŸ“‹ License

MIT – see LICENSE for details

πŸ’¬ Support & Community

πŸ”— Links


Made with ❀️ in Austria by Coder's Cantina

Packages

 
 
 

Contributors