Theme
Engineering

The Construct SDK: Build Custom Spaces with TypeScript

Flakerim Ismani · · 1 min read

The Construct SDK is a TypeScript library for building custom spaces, plugins, and integrations.

Quick Start

bun add construct-sdk

Defining a Space

import { defineSpace } from 'construct-sdk'
import { z } from 'zod/v4'

export default defineSpace({
  name: 'analytics',
  schema: z.object({ dashboardId: z.string() }),
  setup(ctx) {
    ctx.on('dashboard:refresh', async () => {
      const data = await ctx.fetch('/api/metrics')
      ctx.ui.update({ metrics: data })
    })
  }
})