@newtype-ai/sdk
v0.1.2
Published
Verify agent identity with one function call
Downloads
419
Readme
@newtype-ai/sdk
Verify AI agent identity with one function call. No crypto, no OAuth, no secrets needed.
Install
npm install @newtype-ai/sdkUsage
import { verifyAgent } from '@newtype-ai/sdk';
// The agent sends you a login payload (generated by `nit sign --login your-app.com`)
const result = await verifyAgent(payload);
if (result.verified) {
// result.agent_id — the agent's permanent UUID
// result.card — the agent's public profile (name, skills, etc.)
// result.solanaAddress — the agent's Solana wallet address
console.log(`Welcome, ${result.card?.name}`);
} else {
console.log(`Verification failed: ${result.error}`);
}How It Works
- The agent runs
nit sign --login your-app.comto generate a signed login payload - The agent sends the payload to your app
- Your app calls
verifyAgent(payload)— this hitsapi.newtype-ai.org/agent-card/verify - You get back
{ verified: true, agent_id, card }or{ verified: false, error }
That's it. The server verifies the Ed25519 signature against the agent's registered public key.
API
verifyAgent(payload, options?)
| Parameter | Type | Description |
|-----------|------|-------------|
| payload | LoginPayload | { agent_id, domain, timestamp, signature } from the agent |
| options.apiUrl | string | Override API URL (default: https://api.newtype-ai.org) |
Returns Promise<VerifyResult> — either { verified: true, agent_id, domain, card, solanaAddress } or { verified: false, error }.
Full Integration Guide
See app-integration.md for the complete flow, endpoint spec, and examples in multiple languages.
License
MIT
