Inicio rápido
En cinco minutos envías una notificación a tu móvil y recibes una decisión de vuelta en tu código.
Necesitas una cuenta en app.notific.me y Node.js 18 o superior (el SDK también funciona en Bun, Deno, Cloudflare Workers y navegadores).
-
Crea un servicio. En app.notific.me, abre Servicios y tokens y crea un servicio, por ejemplo
billingodeploy-bot. El slug del servicio se convierte en elsourcede tus eventos. -
Crea un token. En la misma pantalla, crea un token para el servicio con el paquete Agente:
events:write,asks:writeyasks:read. Copia el valor (nm_svc_…): se muestra una sola vez. -
Configura el entorno. El SDK lee las dos variables. La pantalla SDKs de app.notific.me muestra la dirección de la API de tu cuenta.
Ventana de terminal export NOTIFICME_URL="https://api.notific.me"export NOTIFICME_TOKEN="nm_svc_..." -
Instala el SDK.
Ventana de terminal npm install @notificme/sdkMientras el paquete no esté en npm, descarga el tarball en SDKs de app.notific.me e instálalo desde el archivo:
npm install ./notificme-sdk-latest.tgz. -
Instala la app y activa las notificaciones. Entra en app.notific.me desde el móvil, instálala como app (PWA) y permite las notificaciones. Mira App, PWA y push.
Envía un evento
Sección titulada «Envía un evento»import { NotificMe } from "@notificme/sdk";
// Reads NOTIFICME_URL and NOTIFICME_TOKEN from the environment.const notific = new NotificMe({ source: "billing" });
const result = await notific.send({ type: "invoice.failed", severity: "high", summary: "Invoice #42 failed", payload: { invoice: 42, amount: 129.9 },});
console.log(result.id, result.status); // "019a…", "queued"curl -sS -X POST "$NOTIFICME_URL/v0/events" \ -H "Authorization: Bearer $NOTIFICME_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "source": "billing", "type": "invoice.failed", "severity": "high", "occurred_at": "'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'", "content": { "summary": "Invoice #42 failed" } }'La API responde 202 Accepted con el id del evento. Unos instantes después la notificación aparece en Mis notificaciones y como push en tu móvil.
Haz una pregunta y espera la respuesta
Sección titulada «Haz una pregunta y espera la respuesta»import { NotificMe } from "@notificme/sdk";
const notific = new NotificMe({ source: "billing" });
// Blocks until a person answers (or the timeout applies onTimeout).const reply = await notific.ask({ title: "Refund order #881 (USD 240)?", questions: [ { id: "decision", type: "single", text: "What should we do?", options: ["Refund", "Partial refund", "Deny"] }, { id: "note", type: "text", text: "Note for the customer", optional: true }, ], level: 2, timeout: "30m", onTimeout: { decision: "Deny" },});
if (reply.status === "answered" && reply.answers.decision === "Refund") { // …refund}console.log(reply.asText); // natural-language summary of the decision# 1. Create the question setcurl -sS -X POST "$NOTIFICME_URL/v0/asks" \ -H "Authorization: Bearer $NOTIFICME_TOKEN" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: refund-881" \ -d '{ "title": "Refund order #881 (USD 240)?", "questions": [ { "id": "decision", "type": "single", "text": "What should we do?", "options": ["Refund", "Partial refund", "Deny"] } ], "level": 2, "timeout": "30m", "on_timeout": { "decision": "Deny" } }'
# 2. Long-poll the answer (up to 60 s per request) with the "id" returned abovecurl -sS "$NOTIFICME_URL/v0/asks/<id>?wait=60" \ -H "Authorization: Bearer $NOTIFICME_TOKEN"En el móvil, abre la notificación, elige una opción y confirma. El nivel 2 pide biometría en la app nativa, o el código 2FA en la app web. Tu código recibe la respuesta firmada:
{ "question_set_id": "019a…", "version": 1, "status": "answered", "answers": [ { "question_id": "decision", "question_text": "What should we do?", "value": "Refund" } ], "as_text": "…", "answered_by": { "identity": "[email protected]", "device_id": "019a…", "level_used": 2, "auth_method": "totp" }, "answered_at": "2026-11-05T12:03:10Z", "content_hash": "…", "signature": { "alg": "Ed25519", "key_id": "…", "value": "…" }}Próximos pasos
Sección titulada «Próximos pasos»- ¿Prefieres no dejar un proceso esperando? Usa
createAsk()concallbackUrly verifica el webhook. - Enriquece la notificación con una tarjeta.
- Conecta Dokploy, GitHub o cualquier sistema que envíe webhooks con un hook de entrada.
- Deja que un agente de IA pida aprobación con el servidor MCP.