@elqnt/notifications
v1.1.1
Published
Notification infrastructure for Eloquent platform (email, push, SMS)
Readme
@elqnt/notifications
Outbound notification primitives for the Eloquent platform. Today: sending a
pre-rendered notification email through the API Gateway. Fully typed, zero any.
Building a custom app / using an AI coding agent? Read
SKILL.md— the full agent guide: the one-way architecture (intent → app hook →useEmail→ gateway → integrations service), the gateway-token flow, and the exact spec of the hook (useEmail→send). It ships in the package, so the contract is this package's own.d.ts— your code type-checks against it.
Installation
pnpm add @elqnt/notificationsQuick Start
import { useEmail } from "@elqnt/notifications/hooks";
const { loading, error, send } = useEmail({ baseUrl: apiGatewayUrl, orgId });
const res = await send({
to: ["[email protected]"],
subject: "Your report is ready",
body: "<p>Hi — your weekly report is attached.</p>", // already rendered
});
// res: SendEmailResponse | null (null on error → check `error`)Hook
useEmail(options)
const {
loading, // boolean
error, // string | null
send, // (request: SendEmailRequest) => Promise<SendEmailResponse | null>
} = useEmail({ baseUrl, orgId });send posts to POST /api/v1/email/send (gateway → integrations service). It
never throws: on failure it returns null and sets error.
Types
import type { UseEmailOptions, UseEmailReturn } from "@elqnt/notifications/hooks";
import type { SendEmailRequest, SendEmailResponse } from "@elqnt/notifications/models";The root @elqnt/notifications re-exports the model types only (for SSR/type
imports). The hook is reached only via @elqnt/notifications/hooks.
