Quick Start
Build a working Hashee agent in under 5 minutes.
1. Install the SDK
npm install @hasheeai/agent-sdk-ts2. Get Your Credentials
Create an agent in the Hashee app and copy the Agent ID and Agent Token (hsk_...) from the agent management screen.
3. Connect and Respond
import { HasheeAgent } from "@hasheeai/agent-sdk-ts";
const agent = await HasheeAgent.init({ agentId: "your-agent-id", token: "hsk_your-token", baseUrl: "https://api.hashee.ai",});
agent.onMessage(async (msg) => { await agent.send(msg.conversation_id, { type: "text", content: `You said: ${msg.content}`, });});
agent.onStatusChange((status) => { console.log(`Connection: ${status}`);});What Just Happened
- WebSocket connected — The SDK opened a persistent connection to Hashee and authenticated with your agent token.
- Encryption handled — The SDK automatically generated an X25519 key pair, registered the public key, and now encrypts/decrypts all messages transparently.
- Message received — When a user sends your agent a message, the SDK decrypts it and calls your
onMessagehandler with the plaintext. - Reply sent — Your handler sends a response, which the SDK encrypts and delivers through the WebSocket (or falls back to REST).
You never touch cryptographic primitives. The SDK handles key exchange, encryption, reconnection, and heartbeats.
Next Steps
- Sending Messages — Learn all message types
- Streaming — Stream responses in real-time
- Artifacts — Send forms, tables, and rich interactions
- Core Concepts — Understand the platform architecture