Jev Events

Introduction

Watch inboxes, calendars, chats and any other stream, ask Jev your questions about each new item, and act on the answers.

Set it up with your coding agent

Pick what to watch and what should happen, then paste the prompt into Claude Code, Cursor or any other coding agent. It reads these docs, writes the code, and tells you each step that needs you.

What to watch
Where it runs
With your own account. The quickest way to try it.
The prompt
Add Jev Events (https://jevevents.dev) to this project. It watches a stream, such as an inbox or a chat, asks Jev, TypeSafe's model, questions about each new item, and runs code on the answers.

What should happen: ask me, and suggest questions and actions that fit.
What to watch: ask me: Gmail, Google Calendar, Slack, Twitch chat or something else.
Where it runs: On my machine, with my own account.

How:
1. Read https://jevevents.dev/llms-full.txt. It has every docs page, and each integration's page has complete, working code for both ways of running it.
2. Start from that code. Use the built-in recipes where one fits, and write your own questions with noul() or choice() where none does.
3. Tell me each step that needs me, such as creating an app, signing in or getting a TypeSafe API key, with the exact commands.
4. Keep `dryRun: true`, so native actions only log what they would do. Never set `dryRun: false` unless I say so.

What it does

Jev Events is an open-source TypeScript library. It watches a stream, such as an inbox, a calendar, a Slack workspace or a Twitch chat, asks TypeSafe's Jev your questions about each new item, and turns the answers into events. You handle each event with a built-in action, such as archiving an email or timing out a chatter, or with your own code.

moderator.ts
import { choice, monitor, recipes } from "jev-events";
import { twitch } from "@jev-events/twitch";

const mods = monitor({
  source: twitch.chat(), // your channel's chat, as you
  questions: {
    kind: choice("What is this chat message doing?", {
      question: "Asks the streamer something",
      spoiler: "Reveals story or boss details",
      other: null,
    }),
    hateful: recipes.chat.hateful,
  },
})
  .on("hateful", { min: 0.9, review: 0.6 }, twitch.timeout({ seconds: 600 }))
  .on("kind:spoiler", twitch.deleteMessage())
  .on("kind:question", (e) => overlay.push(e.item.text)) // your own code
  .on("review", (e) => modQueue.add(e)); // unsure? a human decides

await mods.start(); // native actions are dry-run until { dryRun: false }

Pick a source. google.gmail.inbox(), slack.messages(), twitch.chat(), a webhook, or any async iterable. Every item has the same small shape, plus typed fields for its platform, such as an email's subject.

Ask questions. A choice between labels, a yes/no noul, or a score on your own scale. All of an item's questions go to Jev in one request.

Handle typed events. Event names come from your questions, so "kind:question" exists only if kind has a question label, and a typo is a compile error.

Act. Built-in actions only log what they would do until you turn dry-run off, and never touch protected people, such as colleagues or moderators. Your own functions run as soon as an answer fires.

Two ways to run it

On your machineFor your users
Whose accountYours, signed in once with npx jev-events authEach user's, connected from your app
Runs asA script you start, such as npx tsx monitor.tsRoutes in your web app, plus a worker for chat
Tokens are keptIn .jev-events/ next to your codeIn your Postgres database, encrypted
Start withQuickstartFor your users

Each integration's page has a builder that writes the code for either one. To see what Jev says before writing anything, npx jev-events watch prints its answers in your terminal. See the CLI.

Integrations

The roadmap lists what's coming next.

Why it exists

Jev answers narrow, typed questions about text: which of these labels fits, how likely is yes, where on this scale. Input costs $0.042 per million tokens and output is free, which makes it affordable to ask about every single message in a busy inbox or chat.

The call itself is the easy part. Around it you need sign-in for each user, webhooks and schedules, reconnects, rate limits, a queue that skips messages that waited too long, a daily budget, each platform's API, and a guarantee that your bot never times out a moderator. Jev Events is that part, tested once so you don't rebuild it for every project.

Where your data goes

Jev Events is a library, not a service. It runs in your own process or web app, with your own TypeSafe key and your own apps on each platform. Items go to TypeSafe's API to be judged, actions go straight to the platform, and tokens stay on your machine or in your database.

A community project

Jev Events is built on TypeSafe's public API. It is not made by, affiliated with or endorsed by TypeSafe.

On this page