Ship the app your team opens. Sign-in, roles and data included.
Sign-in, members, permissions, the ontology client and warehouse access for the Next.js app in app/. Your agent writes the screens; the SDK signs people in, keeps the pages you choose public and calls the ontology as the signed-in person.
Get started
$ npm install @segmentstream/appAt a glance
- Next.js App Router 16 or later, React 19
- Email-code sign-in for invited members, sign-up you open, and public pages
- At your-name.segmentstream.app or your own domain
- Records as the signed-in member, typed from your ontology
- The app holds no database or warehouse credentials
What it does
Set up in three files
Configure the app once with the type of your ontology. Every page asks for sign-in except the publicPaths anyone may open, such as a landing page or a public form; a path covers the paths under it, and '/' opens the whole app. The ontology is imported as a type only.
// src/segmentstream.tsimport { createSegmentStreamApp } from "@segmentstream/app";import type ontology from "../../ontology";import link from "../segmentstream.json";export const segmentstream = createSegmentStreamApp<typeof ontology>(link);// src/proxy.tsexport const proxy = segmentstream.proxy({ publicPaths: ["/welcome", "/apply"] });// src/app/api/auth/[...path]/route.tsexport const { GET, POST, PUT, DELETE, PATCH } = segmentstream.authHandlers();Email-code sign-in
People you invite sign in with a six-digit code, or a link the first time. Where the ontology's signUp opens email sign-up, anyone may sign up with the roles it names; otherwise they are asked to request an invitation, and nothing is sent. The form shows your words, in your app's language.
"use client";import { SignIn, type SignInTexts } from "@segmentstream/app/ui";const texts: SignInTexts = { title: "Sign in", continue: "Continue", signedInAs: (email) => `Signed in as ${email ?? "you"}.`, errors: { not_invited: "Ask your administrator for an invitation.", /* … */ }, // …every word the form shows};export function SignInForm() { return <SignIn texts={texts} />;}Who is signed in, and what they may do
Read the member and their roles in server code, and hide controls they may not use. The ontology checks every call again.
const user = await segmentstream.requireUser();// { id, email, name, roles, permissions, ... }<Can permission="lead:changeStatus" fallback={lead.status}> <ChangeStatusForm lead={lead.id} /></Can>Records through the ontology
Find, get, history and actions on every entity, typed from your ontology, as the signed-in member.
const { items, nextCursor } = await segmentstream.ontology.lead.find({ where: { status: { in: ["new", "contacted"] } }, orderBy: [{ field: "createdAt", direction: "desc" }], include: { owner: true }, limit: 20,});const { result, validation } = await segmentstream.ontology.lead.actions.changeStatus( { lead: id, status: "contacted" },);Warehouse data and metrics
Read-only SQL over the workspace warehouse with named parameters, and totals from the metrics declared in your ontology.
const { rows } = await segmentstream.warehouse.query<Revenue>( `SELECT order_date, total_revenue FROM gold.revenue_summary WHERE order_date >= @from ORDER BY order_date`, { params: { from: sql.date("2026-09-01") } },);const totals = await segmentstream.ontology.order.queryMetrics({ dimensions: ["customer.segment"], metrics: ["orders"], dateRange: { from: "2026-09-01", to: "2026-09-30" },});Deploy with one command
segmentstream deploy builds the app with the rest of the workspace and puts it online at your-name.segmentstream.app, or at your own domain once app/domains.json names it. You don't need a hosting account, a server or copied secrets.
$ segmentstream deployAn app built with the App SDK.
SegmentStream HQ, the app our company runs on: sign-in, records and queries through the App SDK, as the signed-in person.

The rest of the surface
Ontology SDK
@segmentstream/ontology
Entities, actions and roles; REST, OpenAPI and MCP from one model
Pipeline SDK
segmentstream-pipeline (Python)
Connections, ingestion, models, checks and schedules in Python
Agent SDK
@segmentstream/agent
The company agent: ontology tools as the member, in your team’s channels
CLI
segmentstream
Workspaces, deploys, members, jobs and data from the terminal
MCP and API
/mcp and /api/ontology on every app
REST, OpenAPI and MCP on every app, per caller
Build your company’s own software. Let agents run it.
$ segmentstream workspace create acme --region eu --subdomain acme
▸ Created workspace acme · database, warehouse and a private git repository
$ segmentstream workspace WORKSPACE-ID clone acme && cd acme
▸ your coding agent builds what your team asked for and runs the checks
$ git add -A && git commit -m "First version"
$ segmentstream deploy
▸ app, company agent, API and MCP tools live for your invited members
Our engineers build the first version on your data in two weeks, at a fixed price.
Or build it yourself with your coding agent:
curl -fsSL https://segmentstream.com/install.sh | sh