BlueForge Docs

client.wallet.createAlert

Create a balance alert threshold

Signature

class Client {
  wallet: {
    createAlert(workspaceId: string, input: CreateAlertInput): Promise<BalanceAlert>
  }
}

Parameters

NameTypeRequiredNotes
workspaceId
string
YesWorkspace ID
input
CreateAlertInput
YesAlert config (thresholdCents, webhookUrl?)

Throws

  • NotFoundError
    — workspace not found
  • ValidationError
    — invalid threshold

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.listAlerts
  • client.wallet.getBalance

Tested against

  • Unit:
    packages/client/src/__tests__/wallet.test.ts