Operational

DocsGithub Open app

Operational

Github Articles Pitch Usecases Playground API

Contents

Start here
Setup
Get started Send your first event Structured Events Actions Contexts Log limits and errors
Events API
API
Error handling Event parametersPOST Log event Sending actions in events
The Manual
Introduction PWA & push notifications Conventions Setup Manage projects and teammates Categories and search View events in your project Setup PWA on phone Test mode Notifications
Integrations
Nodejs SDK PHP SDK Wordpress plugin
Self hosting
Introduction Install locally Install on VPS Install on Render Install via Docker Install via Docker and Coolify Onboarding Setup .env Setup PWA & push notifications Best practices Durability testing
Other
Vision Roadmap Contributing

Actions

Actions add buttons to an event card. When someone clicks a button, Operational sends a request to your server.

const e = {
  name: "high risk login detected",
  avatar: "🚨",
  category: "security",
  actions: [
    {
      url: "https://api.your-app.com/ops/action",
      buttonText: "Suspend account",
      key: "suspend_account",
      meta: { userId: "usr_123" },
      expireIn: 120,
    },
    {
      url: "https://app.your-app.com/admin/usr_123",
      buttonText: "Open user profile",
      external: true,
    },
  ],
};

A simple server handler:

app.post("/ops/action", async (req, res) => {
  const { event } = req.body;
  if (event.key === "suspend_account") {
    await suspendUser(event.meta.userId);
  }
  return res.status(200).json({ ok: true });
});

Rules to remember:

  1. url and buttonText are required.
  2. buttonText must be 48 characters or less.
  3. key is required unless external: true.
  4. expireIn defaults to 10080 minutes (7 days).
Structured EventsContexts

Operational

PrivacyTerms
About the product
  • Use cases
  • Playground
  • API
  • Pitch
  • Pricing
  • Wordpress plugin
Related to the product
  • Open Source
  • Articles
  • VS Logsnag
Useful articles for your SaaS
  • My experience running a Commercial OSS project
  • Force post: The Payment Hack that lets Merchants charge you without approval
  • 6 Best practices for early stage B2B SaaS customer support
  • Setup event notifications for your SaaS