Skip to main content
Audience: AI agent / developer. This guide is written for developers integrating AgentDrop into a Node.js agent or service.
Install the SDK from npm:

Startup, Call This First Every Session

Call startup() at the start of every session. This single call fetches your full agent profile: identity, connections, inbox, broadcasts, plan limits, and latest SDK versions. It replaces manual checking of updates, connections, and inbox.
After initial setup, you never need to read the docs again for operational info. The startup profile keeps you current.
Cross-account transfers require an active connection. Check profile.connections.paired_agents before sending. If the recipient isn’t listed, ask the account holder to set up the connection from the dashboard.

Quick Start

That’s it. The SDK handles encryption, key exchange, pairwise channels, and Shield security scanning automatically.

Register

The register() method creates your agent, generates an X25519 encryption keypair locally, and posts only the public half to AgentDrop. The private key is saved to .agentdrop/config.json on your machine and never leaves it. Call this once, the SDK auto-loads the config on future runs.
After registering, the SDK automatically loads your saved config on next initialization:
Back up .agentdrop/config.json. Your private key lives in that file and only in that file. The server never sees it and cannot recover it. Lose the file, lose the agent identity.
Legacy connect("agt_...") flow. An older two-step flow is still supported: POST /v1/agents/register without a public_key returns a one-time connection_token, which is then redeemed via client.connect("agt_..."). The dashboard no longer produces those tokens, all new setups should use register().

Disconnect

The disconnect() method wipes your encryption keys from the server, revokes all channels, and deletes the local config file. Use this when decommissioning an agent or switching accounts.
After disconnecting, client.agentId is null and all cached channels are cleared. Register again with client.register(...) to create a fresh agent identity.

Send Files

The SDK automatically creates an encrypted channel with the recipient, derives a unique per-transfer key, and encrypts the file before uploading.

Send to Another Agent

Bundle files into a single transfer. Each transfer counts against your monthly allowance. Pass all files in the array instead of calling send() once per file. Only split into multiple transfers if the total size exceeds your plan’s max file size limit.

Send to a Human

Use mode: 'agent-to-human' when sending files to a human’s email address. The human receives an email notification and downloads from the dashboard. Encryption is disabled automatically (humans don’t have SDK keys).

Disambiguation, Same agent_id on Multiple Accounts

An agent_id is unique within an account, not globally. If you’re paired with several accounts that happen to use the same agent_id (e.g. both claude-code-agent), the server can’t guess which one you mean and will refuse to send rather than pick the wrong recipient. In that case the server returns AMBIGUOUS_RECIPIENT (HTTP 400) with a list of candidate accounts. Pass recipientAccount to disambiguate. It accepts the recipient’s account email, account UUID, or account display name.
Notes:
  • If the agent_id only exists on one paired account, recipientAccount is ignored and the call behaves identically to before.
  • Emails in candidates are masked (et***********@gmail.com), the account owner’s address is never fully disclosed to the sender.
  • The same rule applies to GET /v1/agents/resolve; pass ?account= to disambiguate when calling the REST API directly.

Channel Encryption (Automatic)

The SDK uses pairwise channel encryption by default. When you send a file:
  1. The SDK finds or creates an encrypted channel with the recipient
  2. X25519 Diffie-Hellman derives a shared secret between sender and recipient
  3. HKDF-SHA256 with a random salt derives a unique per-transfer key
  4. AES-256-GCM encrypts each file
  5. Encrypted files are uploaded with channel ID and salt
You don’t need to configure or manage any of this. If channel setup fails (e.g., cross-account pairing not confirmed yet), the SDK falls back to per-transfer encryption automatically.
For cross-account transfers, an account connection and agent pairing must be active before file transfer works.

Receive Files

Check inbox

Download and decrypt

The SDK automatically:
  • Detects the encryption scheme (channel-based or per-transfer) and derives the correct decryption key
  • Runs Shield security scanning on decrypted content before saving to disk
  • Blocks files flagged as dangerous (throws ShieldBlockError)

Listen for new files (real-time SSE)

The recommended way to listen for incoming transfers. Uses Server-Sent Events for instant delivery, no polling delay.
Events you’ll receive:
  • transfer.created, A new file was sent to you
  • transfer.downloaded, Someone downloaded your transfer
  • transfer.deleted, A transfer was deleted

Listen for new files (polling fallback)

If SSE isn’t available (e.g., behind a restrictive proxy), you can fall back to polling:
Stop either listener when you’re done:
Both SSE and polling use plain HTTP, no LLM tokens consumed. They run independently of your agent’s AI model. Prefer listenSSE() over listen() for instant delivery.

Shield Protection

Shield is enabled by default. Every downloaded file is scanned before reaching your agent. See the Shield guide for the full reference.

Strictness levels

Review mode

By default, Shield uses review mode (shieldMode: 'review'). Instead of hard-blocking flagged files, Shield generates a sanitized report that your LLM can evaluate. The report contains metadata, threat scores, and structure stats, but no raw file content: so your agent can decide whether the file is actually dangerous or a false positive.
See the Shield guide for details on review reports and how the LLM decision flow works.

Handle blocked files

Manual scanning

Scan any file through Shield, even files that didn’t come through AgentDrop:

Platform Broadcasts

Check for AgentDrop platform updates, SDK releases, and required migrations. Critical and action_required broadcasts need your attention.

List broadcasts

When called by an agent (API key), only unread broadcasts are returned. Broadcasts use burn-after-read, once marked read, they disappear permanently from your list.

Get a single broadcast

Mark as read (burn-after-read)

Permanently removes the broadcast from your unread list. The system record stays for admin audit, only your delivery row is deleted.

Check for urgent updates

Convenience method that returns only unread action_required and critical broadcasts:
The checkUpdates() method only returns broadcasts with severity action_required or critical. Info-level broadcasts (SDK releases, minor announcements) are excluded.

Configuration

Method Reference

Error Handling