nv-endpoint-routed-tool-provider

Implement endpoint-routed Tool-channel providers in Novu following the PagerDuty reference architecture.

39.7k|4.4k|Updated Aug 26, 2021
One-click install
npx skills add https://github.com/novuhq/novu --skill nv-endpoint-routed-tool-provider
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nv-endpoint-routed-tool-provider
Source: https://github.com/novuhq/novu/tree/main/.cursor/skills/nv-endpoint-routed-tool-provider
Command: npx skills add https://github.com/novuhq/novu --skill nv-endpoint-routed-tool-provider

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building or refactoring a Novu Tool-channel provider (PagerDuty, Opsgenie, or new incident/alerting tools) requires coordinating changes across shared types, encryption, DAL indexes, stateless providers, API DTOs, worker send logic, dashboard, docs, and playground, and missing any touch point breaks the feature.

Core Features & Use Cases

  • Mandatory provider discovery gate: Forces reading the target provider's official API docs to pin down secret format, regional endpoints, idempotency, payload contract, and auth transport before writing code.
  • Architecture invariants and checklist: Enforces encrypted per-subscriber secrets on channel endpoints, stateless providers resolving routing from channelData, SKIPPED steps when no endpoint exists, and deterministic dedup keys.
  • Full-stack slice order: Covers packages/shared, stateless, DAL, application-generic, providers, API e2e tests, worker, dashboard, Mintlify docs, and Next.js playground with build and verification commands.
  • Use Case: Refactor Opsgenie from credential-routed env-level API keys to the endpoint-routed PagerDuty model, including removing the credential fallback and checking for existing integrations before migration.

Quick Start

Ask the agent to refactor the Opsgenie tool provider to the endpoint-routed PagerDuty model, starting with the provider discovery gate.

Frequently Asked Questions about nv-endpoint-routed-tool-provider

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new tool provider to Novu?

Start with the discovery gate: read the provider's official API docs to pin down the per-recipient secret format, regional endpoints, idempotency key, payload contract, and auth transport. Then follow the checklist across shared types, encryption, DAL index, stateless provider, API DTOs, worker, docs, and playground.

How do I refactor Opsgenie to the PagerDuty endpoint-routed model?

Run the checklist with opsgenie_* as the endpoint type: empty the opsgenieConfig credentials, drop the API-key read in opsgenie.handler.ts, and add Opsgenie to ENDPOINT_ROUTED_TOOL_PROVIDERS. Check for existing integrations with credentials before deleting the old path, since a migration may be needed.

What happens when a subscriber has no channel endpoint configured?

The workflow step is marked SKIPPED, never errored. The worker send loop checks ENDPOINT_ROUTED_TOOL_PROVIDERS in send-message-tool.usecase.ts and emits an execution detail when no endpoint exists for the subscriber.

Where are tool provider secrets stored in Novu?

Sensitive routing fields like the PagerDuty routing key are encrypted on the ChannelEndpoint.endpoint document via encryptChannelEndpoint, while non-sensitive fields like region stay plaintext. No synthetic ChannelConnection is created, since connections are OAuth-only.

Why does encryptChannelEndpoint throw a Buffer TypeError in tests?

Worker and application-generic specs need STORE_ENCRYPTION_KEY set to a 32-character value in the environment. Without it, encryptChannelEndpoint throws a Buffer TypeError during test execution.

When should I not use the endpoint-routed provider pattern?

Avoid it when the target provider has no per-recipient secret, lacks idempotent deduplication, or only supports OAuth. In those cases the discovery gate halts and recommends a credential-routed tool provider or OAuth connection model instead.