@getdial/sdk - v0.21.0
    Preparing search index...

    Class DialClient

    Index
    • dial billing — wallet balance, subscription, per-number mode, recent credits, and payment methods.

      Returns Promise<Billing>

    • dial call get <id> — fetch a single call by id.

      Parameters

      • callId: string

      Returns Promise<Call>

    • dial call list — list calls, optionally filtered.

      Parameters

      Returns Promise<Call[]>

    • dial message list — list messages, optionally filtered.

      Parameters

      Returns Promise<Message[]>

    • dial number list — list the account's phone numbers.

      Returns Promise<PhoneNumber[]>

    • Open a long-lived connection to the account's event stream.

      This is the SDK equivalent of dial wait-for: rather than returning a single event, it yields every message.received / call.status_changed / call.ended / call.transcribed event on the account channel. Iterate it and filter in your own loop:

      const conn = await client.newEventsConnection();
      try {
      for await (const event of conn) {
      if (event.type === "message.received") handle(event);
      }
      } finally {
      await conn.close();
      }

      The PubNub token is re-minted automatically before it expires.

      Returns Promise<EventsConnection>

    • dial typing start — show a typing indicator to the recipient, as if composing a message from your number. iMessage numbers display it; standard (SMS) numbers have no typing concept and silently ignore it, so calling this unconditionally is safe. Fire-and-forget and free. Delivering a message or reaction clears the indicator natively on the recipient's device — start again after a send to keep composing, and pair with stopTyping when you stop without sending (or use typing, whose session renews it after each send and stops it on dispose).

      Parameters

      Returns Promise<void>

    • dial typing stop — clear a typing indicator previously shown with startTyping.

      Parameters

      Returns Promise<void>

    • Scope a typing indicator to a block: starts immediately, stops on disposal.

      await using session = client.typing({ toNumber, fromNumber });
      await session.sendMessage({ body: "…" }); // to/from prefilled

      Returns synchronously with the start request in flight; a start failure surfaces at the next interaction with the session. Without await using (TypeScript 5.2+ / Node 24+), call session.stop() yourself.

      Parameters

      Returns TypingSession