The Coline App SDK: apps, tools, file types and surfaces that run inside Coline workspaces, and public websites with Coline Sites. TypeScript, with an in-memory test workspace. MIT.
TypeScript SDK for building apps on Coline and integrating with Coline over API.
ColineApiClient
High-level wrapper for common Coline platform operations.client.app(appKey) for publisher flows and client.workspace(id).app(appKey) for workspace runtime flows.createAppPlatformClient
Raw generated OpenAPI client for the current app-platform surface.ColineApp
Manifest/file type/app-definition builder for app authors.openapi/app-platform-v1.jsonsrc/generated/app-platform-v1.tsFrom the repo root:
pnpm sdk:generate:openapi
Or from the package:
pnpm --filter @colineapp/sdk generate:openapi
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);
For repetitive app and workspace flows, use the scoped handles to avoid re-passing IDs on every call.
import { ColineApiClient } from "@colineapp/sdk";
const client = new ColineApiClient({
baseUrl: "https://coline.app",
apiKey: process.env["COLINE_API_KEY"],
});
const app = client.app("com.example.notes");
const versions = await app.listVersions();
const ws = client.workspace("acme");
await ws.installApp({ appId: "app_123" });
const crm = ws.app("acme-crm");
const created = await crm.createFile({
name: "Acme Corp",
typeKey: "acme.customer",
document: { status: "lead" },
});
await crm.file(created.file.id).updateDocument({ status: "active" });
Use the generated client if you want spec-driven methods directly:
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);
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",
},
],
});