Use this file to discover all available pages before exploring further.
The Nonhumans TypeScript SDK gives your AI agent a complete digital identity in a single package. Import one client, pass your API key, and your agent gains access to a real email inbox, crypto and fiat wallet, vector memory, credential vault, LLM model access, always-on compute, phone number, and a live web presence — all fully typed and ready to use in TypeScript or JavaScript projects.
Your agent has a real email address (e.g. alice@nonhumans.ai). Read, send, and reply to messages programmatically.
// Send an emailawait agent.email.send({ to: 'hiring@acme.com', subject: 'Application received', body: 'Thank you for applying. We will be in touch shortly.',})// List recent messagesconst inbox = await agent.email.list({ limit: 20, unread: true })// Get a single message by IDconst message = await agent.email.get('msg_01hx...')// Reply to a message threadawait agent.email.reply('msg_01hx...', { body: 'Following up on your earlier question — see details below.',})
Securely store and retrieve API keys, tokens, and other secrets your agent needs at runtime.
// Store a secretawait agent.vault.set('stripe_key', 'sk_live_...')// Retrieve a secretconst stripeKey = await agent.vault.get('stripe_key')// List all stored secret names (values are never exposed in list)const keys = await agent.vault.list()// ['stripe_key', 'openai_key', 'twilio_sid']// Delete a secretawait agent.vault.delete('stripe_key')
Your agent has a real phone number it can use to send texts and make calls.
// Send an SMSawait agent.phone.sms({ to: '+14155550199', body: 'Your verification code is 849201.',})// Initiate an outbound callconst call = await agent.phone.call({ to: '+14155550199', script: 'Hello, this is Alice calling from Acme to confirm your appointment.',})
This example shows an agent that monitors its inbox for job applications, scores them using an LLM, stores the result in memory, and sends a personalised reply.
import { Nonhumans } from '@nonhumans/sdk'const agent = new Nonhumans({ apiKey: process.env.NONHUMANS_KEY })async function processApplications() { // 1. Fetch unread emails const emails = await agent.email.list({ unread: true, limit: 50 }) for (const email of emails) { // 2. Score the application with an LLM const score = await agent.models.chat({ model: 'gpt-4o', messages: [ { role: 'system', content: 'You are a recruiting assistant. Rate the candidate 1–10 and give a one-sentence reason.', }, { role: 'user', content: email.body }, ], temperature: 0, }) const scoreText = score.choices[0].message.content // 3. Persist to memory await agent.memory.store({ content: `Application from ${email.from}: ${scoreText}`, metadata: { emailId: email.id, from: email.from }, }) // 4. Send a personalised reply await agent.email.reply(email.id, { body: `Hi,\n\nThank you for reaching out. We have received your application and will review it shortly.\n\nBest,\nAlice`, }) } console.log(`Processed ${emails.length} application(s).`)}processApplications()