Dokumentation

TypeScript API surface

Declare app endpoints and export OpenAPI-compatible metadata from TypeScript apps.

Beta Aktualisiert 2026-06-11 Raw Markdown
Der Dokumentationsinhalt ist aktuell auf Englisch veroeffentlicht. Deutsche Dokumentationsrouten sind fuer die Navigation verfuegbar, waehrend Uebersetzungen vorbereitet werden.
Doku-Baum

Relpin can describe app-owned endpoints as an API surface. This is useful for Studio inspection, generated reference, and OpenAPI-compatible tooling.

Define an endpoint

import { defineApiEndpoint, defineApiSurface } from '@app-builder-platform/relpin-sdk/api'

const listOrders = defineApiEndpoint({
  method: 'GET',
  path: '/api/orders',
  summary: 'List orders',
  tags: ['orders'],
  responses: [{ status: 200, description: 'Orders returned' }],
})

export const apiSurface = defineApiSurface({
  title: 'Orders app',
  runtime: 'node',
  endpoints: [listOrders],
})

Convert to OpenAPI

The SDK can convert a Relpin API surface to an OpenAPI document. Use this for app-owned endpoints, not as a claim that Relpin exposes a public platform API during beta.

Keep metadata close to routes

When possible, keep route descriptions near the route implementation. That keeps docs and runtime behavior easier to review together.