Saltar al contenido

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).

  1. Crea un servicio. En app.notific.me, abre Servicios y tokens y crea un servicio, por ejemplo billing o deploy-bot. El slug del servicio se convierte en el source de tus eventos.

  2. Crea un token. En la misma pantalla, crea un token para el servicio con el paquete Agente: events:write, asks:write y asks:read. Copia el valor (nm_svc_…): se muestra una sola vez.

  3. 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_..."
  4. Instala el SDK.

    Ventana de terminal
    npm install @notificme/sdk

    Mientras 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.

  5. 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.

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"

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.

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

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": "…" }
}
  • ¿Prefieres no dejar un proceso esperando? Usa createAsk() con callbackUrl y 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.