@segmentstream/app · app/

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

app/
$ npm install @segmentstream/app

At 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

01

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.

app/src
// 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();
02

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.

app/src/components/sign-in-form.tsx
"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} />;}
03

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.

app/src/app/leads/[id]/page.tsx
const user = await segmentstream.requireUser();// { id, email, name, roles, permissions, ... }<Can permission="lead:changeStatus" fallback={lead.status}>  <ChangeStatusForm lead={lead.id} /></Can>
04

Records through the ontology

Find, get, history and actions on every entity, typed from your ontology, as the signed-in member.

app/src/app/leads/page.tsx
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" },);
05

Warehouse data and metrics

Read-only SQL over the workspace warehouse with named parameters, and totals from the metrics declared in your ontology.

app/src/app/revenue/page.tsx
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" },});
06

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.

terminal
$ segmentstream deploy
Inside SegmentStream

An 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.

hq.segmentstream.app
SegmentStream HQ, the deals pipeline: Lead, Qualification and Opportunity columns with each deal's company, contact, owner, amount and close date
SegmentStream HQ, the app we run our own company on: a Next.js app in app/, on the ontology in ontology/.

The rest of the surface

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

Start a pilot

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

We’ll email you product updates, tips and onboarding help. Unsubscribe anytime.