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.
| baseUrl: "https://coline.app", |
| 5 | apiKey: "col_sk_example", |
| 6 | }); |
| 7 |
| 8 | async function main() { |
| 9 | const apps = await client.GET("/api/v1/apps"); |
| 10 | if (!apps.data) { |
| 11 | throw new Error("Failed to load apps."); |
| 12 | } |
| 13 |
| 14 | const install = await client.POST("/api/v1/workspaces/{workspaceSlug}/apps", { |
| 15 | params: { |
| 16 | path: { |
| 17 | workspaceSlug: "acme", |
| 18 | }, |
| 19 | }, |
| 20 | body: { |
| 21 | appId: "app_123", |
| 22 | }, |
| 23 | }); |
| 24 |
| 25 | if (!install.data) { |
| 26 | throw new Error("Failed to install app."); |
| 27 | } |
| 28 |
| 29 | console.log(apps.data.data.apps); |
| 30 | console.log(install.data.data.installId); |
| 31 | } |
| 32 |
| 33 | void main(); |
| 34 |