Updates and acknowledgements
Send a short message with structured data, a link, or a location. Ask for an acknowledgement when you need a person to confirm. Urgent delivery and acknowledgement are separate options.
PingRoom / SDK
Ask someone on their phone. Get an answer in your application. Keep the next step in your code.
npm install @pingroom/sdkimport { PingRoom } from '@pingroom/sdk';
const pr = new PingRoom({ token: process.env.PINGROOM_TOKEN });
const question = await pr.questions.ask('AB12CD', {
prompt: 'Ship the release?',
options: ['ship', 'hold'],
});
const answer = await pr.questions.waitForAnswer(question.id);
if (answer.state === 'answered' && answer.answer?.value === 'ship') {
// Your release step goes here.
}
@pingroom/sdk · Typed. Zero runtime dependencies.
import os
from pingroom import PingRoom
client = PingRoom(token=os.environ["PINGROOM_TOKEN"])
question = client.questions.ask(
"AB12CD", "Ship the release?", options=["ship", "hold"]
)
answer = client.questions.wait_for_answer(question["id"])
if answer["state"] == "answered" and answer["answer"]["value"] == "ship":
print("Release approved")
Official Python client · See repository for release status.
// With an authenticated client and context:
question, err := client.Questions.Ask(ctx, "AB12CD", pingroom.QuestionInput{
Prompt: "Ship the release?",
Options: pingroom.QuestionOptions("ship", "hold"),
})
if err != nil { return err }
answer, err := client.Questions.WaitForAnswer(ctx, question.ID,
pingroom.WaitOptions{})
if err != nil { return err }
fmt.Println(answer.State)
Official Go client · Context cancellation and deadlines.
use PingRoom\Client;
$pr = new Client(token: getenv('PINGROOM_TOKEN'));
$question = $pr->questions->ask('AB12CD', 'Ship the release?',
options: ['ship', 'hold']);
$answer = $pr->questions->waitForAnswer($question['id']);
if ($answer['state'] === 'answered' && $answer['answer']['value'] === 'ship') {
// Your release step goes here.
}
Official PHP client · Guzzle or Symfony HttpClient.
require 'pingroom'
client = PingRoom::Client.new(token: ENV.fetch('PINGROOM_TOKEN'))
question = client.questions.ask('AB12CD',
prompt: 'Ship the release?', options: %w[ship hold])
answer = client.questions.wait_for_answer(question['id'])
if answer['state'] == 'answered' && answer['answer']['value'] == 'ship'
puts 'Release approved'
end
Official Ruby client · Plain Hash results. No runtime gems.
Example code. No request is sent from this page.
01 / First Ping
Install the TypeScript / JavaScript package, supply an approved agent credential, and send to a room your robot can access. Replace AB12CD with that room’s invite code.
The npm package ships TypeScript declarations and uses native fetch. Node.js 20+, Cloudflare Workers, Deno, and Bun are supported. It is an ES module.
npm install @pingroom/sdk
Store PINGROOM_TOKEN in your server environment. Each send returns the Ping’s ID so you can track it in your own workflow.
import { PingRoom } from '@pingroom/sdk';
const pr = new PingRoom({ token: process.env.PINGROOM_TOKEN });
const ping = await pr.broadcast('AB12CD', {
message: 'The release is ready to review.',
data: { version: '1.4.0' },
idempotencyKey: 'release-1.4.0-ready',
});
console.log(ping.id);
Turn the update into a tappable link to a preview, build, report, or dashboard. Replace the example URL with your own.
import { PingRoom, linkPing } from '@pingroom/sdk';
const pr = new PingRoom({ token: process.env.PINGROOM_TOKEN });
await pr.broadcast('AB12CD', {
message: 'Build 512 is ready.',
data: {
...linkPing({
url: 'https://ci.example.com/builds/512',
buttonLabel: 'Open build',
}),
},
});
02 / Ask, wait, continue
Approvals handle a simple decision. Questions offer choices or a typed reply. Handoffs reach one person privately. Wait helpers return the outcome; your application owns the next action.
Continue only when the result contains the exact approving decision. Pending, expired, and cancelled are separate states.
const approval = await pr.approvals.request('AB12CD', {
question: 'Ship release 1.4.0 to production?',
options: ['Ship it', 'Hold'],
idempotencyKey: 'release-1.4.0-approval',
});
const result = await pr.approvals.waitForDecision(approval.id);
if (result.status === 'decided' && result.decision === 'Ship it') {
// Run your approved release step here.
}
Offer two to four choices and choose who can answer. A question normally resolves on the first answer; resolution_policy: 'all' creates a room poll.
const question = await pr.questions.ask('AB12CD', {
prompt: 'Which environment should I deploy?',
options: [
{ value: 'staging', label: 'Staging' },
{ value: 'prod', label: 'Production', style: 'primary' },
{ value: 'cancel', label: 'Cancel', style: 'danger' },
],
responder_scope: 'room',
ttl: 600,
idempotencyKey: 'release-1.4.0-environment',
});
const result = await pr.questions.waitForAnswer(question.id);
if (result.state === 'answered') {
console.log(result.answer?.value);
}
A handoff goes to one human privately. Use it when an agent needs to give a person the next step or ask them to acknowledge something.
const handoff = await pr.handoffs.requestAck({
prompt: 'The incident needs your attention. Can you take over?',
idempotencyKey: 'incident-42-handoff',
});
const result = await pr.handoffs.waitForResult(handoff.id);
console.log(result.state);
03 / What you can build
Use the same TypeScript client for the room, the update, and the response. Start with a single Ping and add the parts your workflow needs.
Send a short message with structured data, a link, or a location. Ask for an acknowledgement when you need a person to confirm. Urgent delivery and acknowledgement are separate options.
Ask for a decision and receive a structured result. Address the connected human, open a question to the room, or collect votes from room members.
Keep one card updated as a build, delivery, or job moves forward. Running updates are silent; finishing the stream sends a completion alert.
Upload a PDF, Markdown, text, HTML, image, or ZIP, then attach its ID to a Ping or question. Uploads require Pro; each file can be up to 5 MiB, with up to four per send.
List, create, and join rooms your credential permits. Configure Quick Ping slots and trigger saved actions from your application.
Read history, listen for incoming Pings, or accept signed outgoing webhooks. Use the signature helper to verify a delivery before processing its payload.
04 / Beyond hello world
These examples use the same authenticated pr client from the quick start. Each pattern fits into an existing worker, script, or backend service.
Reuse the correlation ID for the same job. PingRoom updates the existing live card on supported devices, then ends it when you send done or failed.
import { liveStatus } from '@pingroom/sdk';
await pr.live.push('AB12CD', liveStatus.progress('deploy-42', {
state: 'running',
message: 'Building the release',
progress: 0.4,
}));
// Update this stream as your job advances.
await pr.live.push('AB12CD', liveStatus.done('deploy-42', 'Release shipped'));
The file travels through an authenticated attachment endpoint. IDs are single-use, and an unattached upload expires after 24 hours.
import { readFile } from 'node:fs/promises';
const report = await pr.attachments.upload({
content: await readFile('report.pdf'),
filename: 'report.pdf',
});
await pr.broadcast('AB12CD', {
message: 'Your nightly report is ready.',
attachment_ids: [report.id],
});
The iterator reads the current head and long-polls forward for new Pings. An AbortSignal lets your process stop listening when its work ends.
const controller = new AbortController();
for await (const ping of pr.notifications.listen({
signal: controller.signal,
})) {
console.log(ping.message);
// Route the incoming Ping in your application.
}
// Call controller.abort() from your shutdown handler.
A room’s incoming webhook URL contains its own secret, so it needs no agent token. Create a webhook with Pro and keep its URL in your server environment.
import { sendIncomingWebhook } from '@pingroom/sdk';
const url = process.env.PINGROOM_WEBHOOK_URL;
if (!url) throw new Error('Set PINGROOM_WEBHOOK_URL');
await sendIncomingWebhook(url, {
message: 'Build 512 passed.',
data: { build: 512 },
}, {
idempotencyKey: 'build-512-passed',
});
05 / Connect with permission
Pair a local integration through PingRoom, or supply an agent credential you already manage. Pairing creates a separate robot that the person claims and gives access to selected rooms or all eligible rooms.
import { PingRoom } from '@pingroom/sdk';
const pr = new PingRoom();
const pairing = await pr.auth.startPairing({ agent_label: 'Release bot' });
console.log(pairing.pair_browser_url ?? pairing.pair_url);
const active = await pr.auth.waitForPairing(pairing);
// The client now uses the approved robot credential.
const room = active.home_room ?? active.room;
if (room) {
await pr.broadcast(room.invite_code, { message: 'Release bot connected.' });
}
The approval screen defines the robot’s room access. Installing the app does not grant permission. Reuse the pending pairing link while the person signs in or installs PingRoom.
Use an environment variable or your secret store for long-lived agent tokens. The JavaScript client works in browsers, but a public browser bundle must never contain your agent credential.
auth.connection() reports the connected owner and robot. auth.disconnect() revokes the credential and its refresh credentials when the integration is no longer needed.
06 / Production behavior
A human might decline, take a while, or never respond. Make those outcomes explicit in your application and put a deadline around work that cannot wait forever.
The server may have accepted a request before it timed out. Reuse its idempotencyKey when retrying a broadcast, approval, or question so the server can replay the original result.
Answered, expired, and cancelled mean different things. A negative answer is a valid result. Gate an action on the exact response you require.
Wait helpers long-poll, back off after transient failures, and honor rate-limit responses. Supply an AbortSignal for your own deadline and onRetry when you need visibility into recovery.
Verify webhook signatures over the raw request body. Require V2 signatures and deduplicate delivery IDs before running work; webhook deliveries can be retried.
const result = await pr.questions.waitForAnswer(question.id, {
signal: AbortSignal.timeout(15 * 60_000),
onRetry: (error, attempt) => {
console.warn('Waiting for PingRoom', { code: error.code, attempt });
},
});
07 / Choose your language
TypeScript and JavaScript are available on npm today. Official Python, Go, PHP, and Ruby clients are available as source repositories; follow their release status and installation guidance before adding them to your project.
Published as @pingroom/sdk. Typed requests, native fetch, no runtime dependencies. Includes pairing, room management, and an MCP client.
Source available. Python 3.9+, with synchronous and async clients built on httpx. Pings, questions, waits, live status, and webhook verification.
Source available. Go 1.22+, standard library only. Network calls accept context.Context for cancellation and deadlines.
Source available. PHP 8.2+ with a PSR-18 HTTP client and PSR-17 factories. Works with Guzzle or Symfony HttpClient.
Source available. Ruby 3.1+, standard library only. Plain Hash results, cancellable waits, attachments, and webhook verification.
The language clients share the core sending and response workflows. Python, Go, PHP, and Ruby do not yet include TypeScript’s pairing, room-management, or MCP helpers. Use an approved agent credential with those clients. Repository changes may precede package releases; check the changelog for the version you install.
08 / Keep building
Read the full API reference, inspect the source, or choose the CLI and MCP when those fit your workflow.
Use the SDK inside an application, worker, or service. Use the CLI for terminal scripts and shell pipelines. Use MCP to give a compatible AI client PingRoom tools. All three use your PingRoom rooms and permissions.
No. A CI job, backend service, scheduled script, or ordinary application can use it. An agent credential is the integration’s identity and permission to access PingRoom.
No. The SDK returns a result to your application. Your code checks the state and chosen answer, then decides whether to continue, stop, or ask again.
The core Ping, human-response, attachment, and live-status workflows are shared. TypeScript has additional account-pairing, room-management, and MCP helpers. Check the README and changelog of the language and version you use.
Attachment uploads and creating room webhooks require Pro. Sending and other capabilities remain subject to the connected account’s plan, room access, and service limits. The API returns a specific error when a capability is unavailable.
All TypeScript methods, configuration, error handling, and runnable examples.
Check the current release and install @pingroom/sdk.
Authentication, room access, requests, and service contracts.
Install the CLI, connect a robot, and build shell workflows.
Set up PingRoom MCP and give your agent a way to reach you.