RobotRock

Getting Started

RobotRock makes it easy to add human-in-the-loop approval workflows to your applications.

Installation

Install the SDK using your preferred package manager:

npm install robotrock
# or
bun add robotrock

Agent skill

For Cursor, Claude Code, and other coding agents, install the RobotRock skill from skills.sh:

npx skills add quintenb/robotrock-skills --skill robotrock

Configure environment

Create an env file and add your RobotRock API key: You can create an API key in the RobotRock app under Settings -> API Keys.

# .env.local
ROBOTROCK_API_KEY=rrk_your_api_key_here

Quick Start

Create a shared client in a dedicated file, then import it wherever you create tasks.

// lib/robotrock.ts
import { createClient } from "robotrock";

export const robotrock = createClient({
  app: "budgeting-service",
  webhook: {
    url: "https://your-app.com/api/robotrock/webhook",
    headers: {
      // place your headers here
    },
  },
});
import { robotrock } from "@/lib/robotrock";

const response = await robotrock.sendToHuman({
  type: "budget-approval",
  name: "Q1 Budget Approval",
  description: "Please review and approve the Q1 budget",
  actions: [
    { id: "approve", title: "Approve" },
    { id: "reject", title: "Reject" },
  ],
});

console.log("Task created:", response.task.taskId);

Handle webhooks

When someone completes a task in the inbox, RobotRock POSTs to the webhook URL on your client. Add a route handler to verify and process the payload:

// app/api/robotrock/webhook/route.ts
import { verifyRobotRockWebhook } from "robotrock";

export async function POST(request: Request) {
  const payload = await verifyRobotRockWebhook(request);

  if (payload.action.id === "approve") {
    // handle approve
  } else if (payload.action.id === "reject") {
    // handle reject
  }

  return Response.json({ ok: true });
}

Next Steps

Integrations

Handling

  • Webhooks - Receive callbacks when tasks are handled
  • Polling - Wait in-process when no webhook is configured

On this page