@business-os/sdk
v1.0.0
Published
TypeScript SDK for Knibo Platform - Restaurant OS, Handwerker, and more
Maintainers
Readme
@knibo/sdk
TypeScript SDK for the Knibo Platform - a multi-industry business management platform.
Installation
pnpm add @knibo/sdk
# or
npm install @knibo/sdkIndustries
- Restaurant - Menu management, events, blog, reviews
- Handwerker - Services, portfolio, leads (coming soon)
Usage
Restaurant
import { RestaurantClient } from '@knibo/sdk'
const client = new RestaurantClient({
apiUrl: 'https://restaurant-os-three.vercel.app',
businessId: 'your-restaurant-id',
revalidate: 60 // cache time in seconds
})
// Menu
const menu = await client.getHauptspeisekarte()
const drinks = await client.getGetraenkekarte()
const seasonal = await client.getSaisonkarte()
const lunch = await client.getCurrentMittagskarte()
// Events
const events = await client.getUpcomingEvents()
// Blog
const posts = await client.getBlogPosts()
const post = await client.getBlogPostBySlug('my-post')
// Reviews
const reviews = await client.getReviews({ limit: 5, minRating: 4 })
const stats = await client.getReviewStats()Handwerker (Tradesman)
import { HandwerkerClient } from '@knibo/sdk'
const client = new HandwerkerClient({
apiUrl: 'https://restaurant-os-three.vercel.app',
businessId: 'your-handwerker-id'
})
// Services
const services = await client.getServices()
const byCategory = await client.getServicesByCategory()
const emergency = await client.getEmergencyServices()
// Portfolio
const projects = await client.getPortfolio()
const featured = await client.getFeaturedProjects()
// Leads
await client.submitLead({
name: 'John Doe',
email: '[email protected]',
phone: '+49 123 456789',
message: 'I need help with...',
source: 'website'
})Tree-shaking
Import only what you need:
// Only restaurant types
import { RestaurantClient, type MenuItem } from '@knibo/sdk/restaurant'
// Only handwerker types
import { HandwerkerClient, type Service } from '@knibo/sdk/handwerker'
// Only shared types
import { type BlogPost, type Review } from '@knibo/sdk/core'Migration from @restaurant-os/sdk
// Old
import { RestaurantOSClient, RestaurantOSConfig } from '@restaurant-os/sdk'
// New (backwards compatible)
import { RestaurantOSClient, RestaurantOSConfig } from '@knibo/sdk'
// Or use new names
import { RestaurantClient, RestaurantClientConfig } from '@knibo/sdk'License
MIT
