Início rápido
Em cinco minutos você envia uma notificação para o seu celular e recebe uma decisão de volta no seu código.
Você precisa de uma conta em app.notific.me e do Node.js 18 ou mais novo (o SDK também roda em Bun, Deno, Cloudflare Workers e navegadores).
-
Crie um serviço. Em app.notific.me, abra Serviços e tokens e crie um serviço, por exemplo
billingoudeploy-bot. O slug do serviço vira osourcedos seus eventos. -
Crie um token. Na mesma tela, crie um token para o serviço com o pacote Agente:
events:write,asks:writeeasks:read. Copie o valor (nm_svc_…): ele aparece uma vez só. -
Configure o ambiente. O SDK lê as duas variáveis. A tela SDKs do app.notific.me mostra o endereço da API da sua conta.
Janela do terminal export NOTIFICME_URL="https://api.notific.me"export NOTIFICME_TOKEN="nm_svc_..." -
Instale o SDK.
Janela do terminal npm install @notificme/sdkEnquanto o pacote não está no npm, baixe o tarball em SDKs no app.notific.me e instale pelo arquivo:
npm install ./notificme-sdk-latest.tgz. -
Instale o app e ative as notificações. Entre no app.notific.me pelo celular, instale como app (PWA) e permita as notificações. Veja App, PWA e push.
Envie um evento
Seção intitulada “Envie um 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" } }'A API responde 202 Accepted com o id do evento. Instantes depois a notificação aparece em Minhas notificações e como push no seu celular.
Faça uma pergunta e espere a resposta
Seção intitulada “Faça uma pergunta e espere a resposta”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"No celular, abra a notificação, escolha uma opção e confirme. O nível 2 pede biometria no app nativo, ou o código 2FA no app web. Seu código recebe a resposta assinada:
{ "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 passos
Seção intitulada “Próximos passos”- Não quer deixar um processo esperando? Use
createAsk()comcallbackUrle verifique o webhook. - Deixe a notificação mais rica com um card.
- Conecte o Dokploy, o GitHub ou qualquer sistema que envie webhooks com um hook de entrada.
- Deixe um agente de IA pedir aprovação com o servidor MCP.