Docs/Builder

Builder Overview

The builder is a separate sub-export from @ambersecurityinc/notifly/builder that provides everything you need to build a notification URL configuration UI — without any UI framework dependencies.

Why a separate export?

The builder is designed for UI use cases:

  • A settings page where users configure their notification services
  • A webhook URL converter ("paste your Discord URL and get a notifly URL")
  • A form that validates fields before generating a URL

Keeping it separate means server-side code using only notify() doesn't pay the cost of bundling schema data it doesn't need.

Import

all builder exports
import {
  // Schema queries
  getServiceSchemas,
  getServiceSchema,
  searchServices,
  getServicesByCategory,
  getCategories,

  // Validation
  validateFields,

  // URL generation
  buildUrl,
  decomposeUrl,

  // Smart paste
  smartParse,
  detectAndConvert,
  isRawServiceUrl,
} from '@ambersecurityinc/notifly/builder';

Typical flow

typical ui flow
import {
  getServiceSchema,
  validateFields,
  buildUrl,
} from '@ambersecurityinc/notifly/builder';

// 1. Get the schema (fields, labels, help text)
const schema = getServiceSchema('discord');

// 2. Render a form using schema.fields
// (your UI framework of choice)

// 3. Validate on submit
const errors = validateFields('discord', {
  webhook_id: userInput.webhookId,
  webhook_token: userInput.webhookToken,
});

if (errors.length === 0) {
  // 4. Build the URL
  const { url, success } = buildUrl('discord', {
    webhook_id: userInput.webhookId,
    webhook_token: userInput.webhookToken,
  });
  // Store url somewhere — pass it to notify() later
}

Builder exports at a glance

ExportPurpose
getServiceSchemas()Get all service schemas
getServiceSchema(service)Get schema for one service
searchServices(query)Fuzzy search schemas
getServicesByCategory(cat)Filter schemas by category
getCategories()All categories with counts
validateFields(service, fields)Validate field values against schema
buildUrl(service, fields)Build a notifly URL from field values
decomposeUrl(url)Decompose a URL back into field values
smartParse(input)Parse any URL (raw or notifly format)
detectAndConvert(rawUrl)Convert a raw webhook URL to notifly format
isRawServiceUrl(input)Check if a string is a raw provider URL
← PreviousWebhook (Generic)Next →Schemas