client.wallet.createAlert
Create a balance alert threshold
Signature
class Client {
wallet: {
createAlert(workspaceId: string, input: CreateAlertInput): Promise<BalanceAlert>
}
}
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| workspaceId | | Yes | Workspace ID |
| input | | Yes | Alert config (thresholdCents, webhookUrl?) |
Throws
— workspace not foundNotFoundError
— invalid thresholdValidationError
Examples
import { Client } from '@blueforge/client'
const bf = new Client({ apiKey: process.env.BF_API_KEY!, url: 'https://your-project.blueforge.dev' })
const alert = await bf.wallet.createAlert('ws_abc', { thresholdCents: 1000 })
Pitfalls
- One-shot — alerts fire once when breached; re-arm via the wallet dashboard or re-create after trigger
See also
client.wallet.listAlertsclient.wallet.getBalance
Tested against
- Unit:
packages/client/src/__tests__/wallet.test.ts