The smart paste functions let users paste any URL — a raw webhook URL copied from Discord
settings, a Slack app config page, etc. — and get back a notifly URL ready to use.
smartParse()
paste any webhook url
▌
↓
notifly url
smartParse()
The all-in-one function. Accepts either a raw provider URL (https://discord.com/...)
or an existing notifly URL (discord://...) and returns a normalised result.
signature
function smartParse(input: string): DetectResult | null
Convert a raw provider URL (http/https from a service's dashboard) to a notifly URL. Returns
null if the URL doesn't match any known pattern.
typescript
import { detectAndConvert } from '@ambersecurityinc/notifly/builder';const result = detectAndConvert( 'https://hooks.slack.com/services/T00/B00/XXXX');// → { service: 'slack', notiflyUrl: 'slack://T00/B00/XXXX', fields: { ... } }// Won't match a notifly URL (use decomposeUrl for that)detectAndConvert('discord://123/abc'); // → null
isRawServiceUrl()
Returns true if the string looks like a raw provider URL (http/https), rather than
a notifly scheme URL.
typescript
import { isRawServiceUrl } from '@ambersecurityinc/notifly/builder';isRawServiceUrl('https://discord.com/api/webhooks/123/abc'); // trueisRawServiceUrl('discord://123/abc'); // falseisRawServiceUrl('not a url at all'); // false
Supported raw URL conversions
Service
Raw URL pattern
Converted to
Discord
discord.com/api/webhooks/ID/TOKEN
discord://ID/TOKEN
Slack
hooks.slack.com/services/A/B/C
slack://A/B/C
ntfy
ntfy.sh/TOPIC
ntfy://TOPIC
More raw URL patterns will be added as services are updated to expose copyable webhook URLs.
Use buildUrl() with manual field entry for
services not yet covered.