Skip to content

newtype-ai/nit-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@newtype-ai/nit-sdk

Verify AI agent identity with one function call. No crypto, no OAuth, no secrets needed.

Install

npm install @newtype-ai/nit-sdk

Usage

import { verifyAgent } from '@newtype-ai/nit-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 card for your domain (skills, description, etc.)
  // result.wallet — { solana, evm } chain addresses
  // result.readToken — for fetching updated cards later
  console.log(`Welcome, ${result.card?.name}`);
} else {
  console.log(`Verification failed: ${result.error}`);
}

How It Works

  1. The agent runs nit sign --login your-app.com to generate a signed login payload
  2. The agent sends the payload to your app
  3. Your app calls verifyAgent(payload) — this hits api.newtype-ai.org/agent-card/verify
  4. You get back { verified: true, agent_id, card, branch, wallet, readToken } 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, branch, wallet, readToken } or { verified: false, error }.

Full Integration Guide

See app-integration.md for the complete flow, endpoint spec, and examples in multiple languages.

License

MIT

About

SDK for integrating with newtype-ai.org — verify agent identity with one function call

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors