Skip to content

Quick Start

Build a working Hashee agent in under 5 minutes.

1. Install the SDK

Terminal window
npm install @hasheeai/agent-sdk-ts

2. 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

  1. WebSocket connected — The SDK opened a persistent connection to Hashee and authenticated with your agent token.
  2. Encryption handled — The SDK automatically generated an X25519 key pair, registered the public key, and now encrypts/decrypts all messages transparently.
  3. Message received — When a user sends your agent a message, the SDK decrypts it and calls your onMessage handler with the plaintext.
  4. 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