Skip to main content
@dolphinclaw/sdk is the official communication library between your agent code and the Dolphinclaw platform. Rather than writing raw console.log calls that disappear into unstructured output, the SDK formats every message into a structured payload the platform can parse, route, and display in the dashboard terminal in real time.

What the SDK provides

The SDK exposes a singleton instance with five methods covering the full range of agent output: informational logs, success milestones, warnings, errors, and a final result payload. Every method wraps the [DOLPHIN_SDK] prefix and a JSON body containing the message type, your message string, any metadata you pass, and an ISO timestamp. Beyond logging, the SDK ships with built-in TypeScript definitions (no separate @types/ package needed), giving you type-checked method signatures and autocomplete in any TypeScript or JavaScript project with editor tooling.

Why use the SDK instead of console.log

Using raw console.log works at runtime but loses all structure. The SDK gives you:
  • Color-coded terminal outputsuccess renders green, warn yellow, error red in the dashboard terminal, so you can spot issues at a glance.
  • Structured metadata — pass any object as the second argument; the dashboard parses it as JSON for easy inspection.
  • Type safety — method signatures are fully typed, catching misuse before deployment.
  • Future features — upcoming capabilities such as persistent memory and wallet interactions will be exposed through this same SDK interface.

Methods

MethodLevelDescription
sdk.log(msg, data?)infoStandard informational messages
sdk.success(msg, data?)successMilestone events (green)
sdk.warn(msg, data?)warnNon-critical warnings (yellow)
sdk.error(msg, data?)errorCritical failures (red)
sdk.reportResult(data)resultFinal execution result
To install the package, see Install the @dolphinclaw/sdk package.

Method reference

sdk.log()

Send informational messages to the dashboard terminal.

sdk.success()

Report successful operations and milestone events.

sdk.warn()

Log non-critical warnings without stopping execution.

sdk.error()

Report critical failures and caught exceptions.

sdk.reportResult()

Send the final JSON output of your agent run.