# @colineapp/sdk TypeScript SDK for building apps on Coline and integrating with Coline over API. ## What it includes - `ColineApiClient` High-level wrapper for common Coline platform operations. - `createAppPlatformClient` Raw generated OpenAPI client for the current app-platform surface. - `ColineApp` Manifest/file type/app-definition builder for app authors. - Generated OpenAPI artifacts - `openapi/app-platform-v1.json` - `src/generated/app-platform-v1.ts` ## Regenerate the OpenAPI client/types From the repo root: ```bash pnpm sdk:generate:openapi ``` Or from the package: ```bash pnpm --filter @colineapp/sdk generate:openapi ``` ## Quickstart ```ts import { ColineApiClient } from "@colineapp/sdk"; const coline = new ColineApiClient({ baseUrl: "https://coline.app", apiKey: process.env["COLINE_API_KEY"], }); const apps = await coline.listApps(); console.log(apps.apps); ``` ## Raw generated client Use the generated client if you want spec-driven methods directly: ```ts import { createAppPlatformClient } from "@colineapp/sdk"; const client = createAppPlatformClient({ baseUrl: "https://coline.app", apiKey: process.env["COLINE_API_KEY"], }); const { data, error } = await client.GET("/api/v1/apps"); if (error) throw error; console.log(data.data.apps); ``` ## Typed app registration ```ts import { ColineApiClient } from "@colineapp/sdk"; const client = new ColineApiClient({ baseUrl: "https://coline.app", apiKey: process.env["COLINE_API_KEY"], }); await client.registerApp({ version: "0.1.0", manifest: { key: "com.example.notes", name: "Example Notes", permissions: ["app.home.read", "files.read", "files.write"], notificationChannels: [], hosting: { mode: "external", baseUrl: "https://notes.example.com", }, }, fileTypes: [ { typeKey: "com.example.notes.note", name: "Note", storage: "coline_document", indexable: true, homeRenderMode: "cached", }, ], }); ```