URL 驱动
用 webhook://、smtp://、pushplus:// 等 URL 描述通知目标,配置可以落在 JS 文件、环境变量或部署平台 Secret 中。
pnpm add @noblesnowfield/unicallimport { createDefaultProviderRegistry, notify } from '@noblesnowfield/unicall';
await notify(
'webhook://127.0.0.1:4317/mock/webhook?scheme=http&method=POST',
{
title: 'Unicall 测试',
text: '这是一条本地 Webhook 通知。'
},
{
registry: createDefaultProviderRegistry()
}
);浏览器直连只适合无敏感凭据的公开接口或你自己的后端代理。不要把企业微信、飞书、钉钉、SMTP、WxPusher、Pushplus 等服务端密钥暴露在前端代码、HTML 或公开构建产物中。