SDK de JavaScript: referencia de notificaciones
Todo método de envío y administración de notificaciones, con su firma.
6 min leer·Nivel referencia·Revisado el 12 oct 2026
Este texto en inglés se generó automáticamente a partir del original en francés y aún no ha sido revisado.
Esta página fue traducida automáticamente. La versión en inglés es autorizada.
#
clase
Servicio de notificaciones
| Propiedad | Descripción |
|---|---|
readonly admin: NotificationsAdminService | Subcliente de administración: estadísticas, cola, scrap (DLQ), registros de proveedores, eventos, reglas y configuraciones. |
| Método | Descripción |
|---|---|
send(options: SendNotificationOptions): Promise<AuraResponse<Notification>>send(channel: NotificationChannel, recipient: string, body: string, options?: { subject?: string; templateId?: string; variables?: Record<string, unknown>; metadata?: Record<string, unknown>; idempotencyKey?: string; }): Promise<AuraResponse<Notification>> | Pone en cola una notificación para enviar (API de objetos modernos). |
sendBatch(items: Array<SendNotificationRequest | SendNotificationItem>): Promise<AuraResponse<BatchSendResponse>> | Envía un lote de notificaciones (POST /send/batch). |
sendEmail(recipient: string, subject: string, body: string, options?: SendEmailOptions): Promise<AuraResponse<Notification>> | Envía un correo electrónico transaccional (channel: 'email'). |
sendSms(recipient: string, body: string, options?: SendSmsOptions): Promise<AuraResponse<Notification>> | Envía un SMS transaccional (channel: 'sms'). |
sendPush(recipient: string, title: string, body: string, options?: SendPushOptions): Promise<AuraResponse<Notification>> | Envía una notificación push móvil (channel: 'push', FCM o APN). |
sendWebhook(targetUrl: string, event: string, payload: string | Record<string, unknown>, options?: SendWebhookOptions): Promise<AuraResponse<Notification>> | Emite un webhook HTTP POST saliente (channel: 'webhook'). |
retry(id: string): Promise<AuraResponse<Notification>> | Vuelva a intentar una notificación fallida (status: 'failed' o 'dead_lettered'). |
list(options?: { channel?: NotificationChannel; status?: NotificationStatus; search?: string; sort?: 'created_at' | 'updated_at' | 'status'; order?: 'asc' | 'desc'; limit?: number; offset?: number; }): Promise<AuraResponse<Notification[]>> | Muestra el historial de notificaciones del proyecto, filtrable por channel, status y search, ordenado por created_at, updated_at o status, con paginación limit/offset. |
get(id: string): Promise<AuraResponse<Notification>> | Lee una notificación por su identificador. |
listTemplates(): Promise<AuraResponse<NotificationTemplate[]>> | Enumera las plantillas de mensajes del proyecto. |
getTemplate(id: string): Promise<AuraResponse<NotificationTemplate>> | Lee una plantilla de mensaje por su identificador. |
createTemplate(template: Omit<NotificationTemplate, 'id' | 'project_id' | 'created_at' | 'updated_at'>): Promise<AuraResponse<NotificationTemplate>> | Crea una plantilla: name, channel, subject, body y nada más. |
updateTemplate(id: string, updates: Partial<Pick<NotificationTemplate, 'name' | 'subject' | 'body'>>): Promise<AuraResponse<NotificationTemplate>> | Actualiza una plantilla: name, subject y/o body. |
deleteTemplate(id: string): Promise<AuraResponse<null>> | Elimina una plantilla de mensaje. |
#
clase
Servicio de administración de notificaciones
| Método | Descripción |
|---|---|
getSettings(): Promise<AuraResponse<NotificationSettingsPublic>> | Recupera la configuración de cuota y proveedor público del proyecto (GET /settings). |
updateSettings(settings: NotificationSettingsPatch | Partial<NotificationSettings>): Promise<AuraResponse<NotificationSettingsPublic>> | Actualiza la configuración de cuota o proveedor del proyecto (PATCH /settings). |
getStats(options?: { window?: NotificationStatsWindow; channel?: NotificationChannel; }): Promise<AuraResponse<NotificationStats>> | Estadísticas de envío agregadas (GET /stats). |
getQueue(): Promise<AuraResponse<NotificationQueueStats>> | Lee el estado de la cola de envío: profundidad y distribución de notificaciones pendientes. |
listAttempts(notificationId: string): Promise<AuraResponse<NotificationAttempt[]>> | Enumera los intentos de enviar una notificación, con la respuesta del proveedor a cada uno. |
listDeadLetters(options?: { channel?: NotificationChannel; search?: string; limit?: number; offset?: number; }): Promise<AuraResponse<NotificationDeadLetter[]>> | Enumera las notificaciones colocadas en la cola de basura (DLQ), filtrables por channel y search. |
retryDeadLetter(id: string): Promise<AuraResponse<Notification>> | Reenvía una notificación específica desde la cola de desechos (DLQ). |
listEvents(options?: { status?: 'received' | 'matched' | 'ignored' | 'failed' | 'enqueued'; limit?: number; offset?: number; }): Promise<AuraResponse<NotificationEvent[]>> | Enumera los eventos recibidos por el motor de reglas, filtrables por status. |
listProviderLogs(options?: { channel?: NotificationChannel; status?: NotificationAttemptStatus; limit?: number; offset?: number; }): Promise<AuraResponse<NotificationProviderLog[]>> | Registros de ejecución de proveedores externos (GET /providers/logs). |
previewTemplate(id: string, variables: Record<string, unknown>): Promise<AuraResponse<NotificationTemplatePreview>> | Representa un modelo con el variables dado para obtener una vista previa, sin enviar un mensaje. |
listRules(): Promise<AuraResponse<NotificationRule[]>> | Enumera las reglas de notificación del proyecto (activación automática de un envío). |
createRule(rule: CreateNotificationRuleRequest): Promise<AuraResponse<NotificationRule>> | Crea una regla de notificación: para cada evento de tipo trigger_type que verifica condition, se envía un mensaje el channel al destinatario proporcionado por recipient_expr, con un retraso opcional. |
getRule(id: string): Promise<AuraResponse<NotificationRule>> | Lee una regla de notificación por su identificador. |
updateRule(id: string, updates: UpdateNotificationRuleRequest): Promise<AuraResponse<NotificationRule>> | Actualiza una regla de notificación: solo cambian los campos proporcionados (por ejemplo, enabled). |
deleteRule(id: string): Promise<AuraResponse<null>> | Elimina una regla de notificación. |
página generada
Esta página se genera a partir de las declaraciones de tipo y los comentarios del SDK, por lo que no puede derivarse del código publicado. Para ver ejemplos resueltos, lea las guías.
Última actualización · 12 oct 2026