Introduction
Interval allows you to build internal apps in your backend codebase with zero frontend code.
If you're a developer who wants to offer your non-technical teammates tools for things like managing accounts, moderating content, and editing database records, Interval is for you.
info
Looking for a crash course in Interval? We recommend following our Getting started tutorial which walks you through each step of building and deploying a fully functional customer refund app.
How Interval works
Interval apps are defined as actions in your codebase and can be accessed through your team's Interval web dashboard.
Here's an app with a single "Hello, world" action:
- TypeScript
- JavaScript
import path from "path";
import { Interval } from "@interval/sdk";
const interval = new Interval({
endpoint: "wss://<YOUR INTERVAL SERVER URL>/websocket", // Don't forget the /websocket path!
apiKey: "<YOUR API KEY>",
routesDirectory: path.resolve(__dirname, "routes"),
});
interval.listen();
import { Action, io } from "@interval/sdk";
export default new Action(async () => {
const name = await io.input.text("Your name");
return `Hello, ${name}`;
});
const path = require("path");
const { Interval } = require("@interval/sdk");
const interval = new Interval({
endpoint: "wss://<YOUR INTERVAL SERVER URL>/websocket",
apiKey: "<YOUR API KEY>",
routesDirectory: path.resolve(__dirname, "routes"),
});
interval.listen();
const { Action, io } = require("@interval/sdk");
module.exports = new Action(async () => {
const name = await io.input.text("Your name");
return `Hello, ${name}`;
});
Interval is a hybrid architecture under which business logic and secrets live within your infrastructure and the rendering of interfaces for your tools is handled by an instance of Interval Server.
The code that defines an action runs in your codebase and on your infrastructure. When you make a call to an I/O method (like io.input.text in the above example), the SDK sends a message back to Interval to render the appropriate UI for the person running your action. When a response is received by the SDK, it's parsed, sanitized, and returned to your function as a soundly typed value.