@bondi-labs/integration-sdk - v0.0.2
    Preparing search index...

    Class BondiTriggerBase<TSchema>

    Base class for Bondi trigger emitters in NestJS apps.

    @BondiTrigger({ name: 'contact.created', payload: contactPayload }) export class ContactCreatedTrigger extends BondiTriggerBase {}

    constructor(private contactCreated: ContactCreatedTrigger) {} this.contactCreated.emit({ id: '123', email: 'a@b.com' }); // type-safe via generic

    BondiModule wires the BondiClient + integration slug after construction.

    Type Parameters

    • TSchema extends ZodTypeAny = ZodTypeAny
    Index

    Constructors

    Methods

    • Fire-and-forget emit. Returns immediately; failures flow to the onEmitError callback (or console.warn if none configured) — never thrown into your business logic.

      Use this when you want the trigger to be observability/best-effort — not on the critical path of the request.

      Parameters

      • payload: TypeOf<TSchema>

        Strongly typed via the class's Zod generic.

      Returns void

    • Awaiting variant — awaits the 202 acknowledgement from Bondi and throws on failure. Use when you need to ensure the event was accepted before returning to the caller (e.g. inside a transaction commit hook).

      Parameters

      • payload: TypeOf<TSchema>

        Strongly typed via the class's Zod generic.

      Returns Promise<void>

      If the request fails or the server returns a non-2xx/non-202 status.