Nightshift for Engineering
Data engineering in Javascript with Fiber.
Write type safe SQL queries for scripting alerts, dashboards, transformations, and apps all in a single Javascript file. Ship an entire data product by lunch.
// types are generated from the SQL
export const revenueByMonth = defineQuery(`
SELECT month, sum(amount) AS revenue
FROM orders
WHERE region = $region
`)
const rows = useQuery(revenueByMonthconst revenueByMonth: Query<{
month: string;
revenue: number;
}, { region: string }>, { region })$ npm i @nightshift-sdk/fiberLess plumbing
Stop yak shaving.
A dashboard should be one file, not a trek across your cloud console. Fiber is JavaScript and SQL, the two languages you and your agents already write, so the query, the transform, and the chart live together in your editor. Ship in an afternoon instead of waiting on access tickets and debugging pipelines.
- JavaScript and SQL, nothing new to learn
- Query, transform, and chart in a single file
- Ship in an afternoon, no access ticket or pipeline to babysit
import { defineQuery, useQuery, LineChart } from '@nightshift-sdk/fiber'
const revenue = defineQuery(`
SELECT month, SUM(amount) AS revenue
FROM orders GROUP BY 1 ORDER BY 1
`)
export function Revenue() {
return <LineChart query={useQuery(revenue)} x="month" y="revenue" />
}
One file, the whole job
Colocate your data, alerting, and dashboards.
A transform, an alert, and a dashboard are all just SQL plus a few lines of JavaScript. Pick one to see how little it takes.
Transform your data
- Clean and reshape in SQL with defineModel, no warehouse object to create
- Read the result back anywhere, fully typed
- Land it in a managed table when you want it cached
import { defineModel, useQuery } from '@nightshift-sdk/fiber'
// transform in SQL, no warehouse object to manage
defineModel('daily_revenue', `
SELECT date_trunc('day', ordered_at) AS day,
SUM(amount) AS revenue
FROM orders
WHERE amount > 0
GROUP BY 1
`)
// read the transform anywhere, typed
const rows = useQuery('SELECT * FROM daily_revenue ORDER BY day')
AI-native by default
Your agent’s data tool, already built.
Point Claude Code, Cursor, or your own agent at the Nightshift MCP server and it gets your catalog as a tool. It reads the schema and writes its own SQL, the grant decides what it can see, and every query is logged. No retrieval tool to build, no embeddings to maintain. The agent queries live data the same way Fiber does.
Claude Code
Add the server with one command.
claude mcp add nightshift \
--url https://mcp.nightshift.shThe catalog appears as a tool. Every request it makes is shaped by your policies before a row is returned.
Safe by default
Ship without a data-access ticket.
Your token carries a read grant on a view, so you see the columns you are allowed to and nothing else. Masking happens at the view, writes are denied unless granted, and in prod the token lives behind the Fiber proxy so the browser never holds it. Publish a public app and the query manifest pins exactly what it can run.
- Read grant on a view: masked columns, denied writes
- Token stays server-side behind the proxy, every query logged
- fiber publish pins public apps to a query manifest
// server route: the token stays here, never in the browser
import { createFiberProxy } from '@nightshift-sdk/fiber-proxy'
const proxy = createFiberProxy({
token: process.env.NIGHTSHIFT_TOKEN, // read grant, server-side only
org: process.env.NIGHTSHIFT_ORG,
})
export const POST = (req: Request) => proxy(req)
Questions engineers ask
What you will want to know.
- Do I need to learn a new framework?
- No. Fiber is JavaScript and SQL, the two things your team and your agents already write. There is no new DSL, no Python pipeline glue, and no vendor console. Add the SDK and you are productive in minutes.
- What languages and frameworks?
- Fiber is a typed TypeScript and React SDK. Over the wire it is plain HTTPS: send { sql, params }, get back { columns, rows }, so any language can call it. Any MCP client (Claude Code, Cursor, your own agent) gets the catalog as a tool.
- Can agents write to my data?
- Reads by default. A token carries a read grant, so an agent can query but never change anything. Structured writes (insert, update, delete on a table) need an explicit write grant, so nothing touches prod by accident.
- Do I need a warehouse first?
- No. Nightshift runs a per-org DuckDB over your data in columnar Parquet, so reads come back sub-second with no warehouse to size or manage. $0 per-query compute: you pay for storage, not for every SELECT.
- How does auth work in production?
- A scoped token holds a read grant. The Fiber proxy keeps it server-side so the browser never sees it. For public apps, fiber publish pins a manifest of allowed queries and the browser sends a query id, so an unknown query is rejected at the gateway. Every request is grant-checked and logged.
Build on your data this afternoon.
Start free, run npm i @nightshift-sdk/fiber or add Nightshift to your agent over MCP, and ship data into your product with access control built in.
Want to look first? Take the product tour
