← nondual

TypeScript SDK

Typed methods for every operation. Works in Node.js and any TypeScript project.

Install

npm install nondual
# or
pnpm add nondual

Init

import { Nondual } from 'nondual';

const nd = new Nondual({
  apiKey: process.env.NONDUAL_API_KEY,
});

If apiKey is omitted the SDK reads NONDUAL_API_KEY from the environment automatically.

nd.resolve(input, options?)

Resolve an email or LinkedIn URL to a full contact profile.

const { contact } = await nd.resolve({ email: 'jane@acme.com' });

console.log(contact.name);                    // "Jane Smith"
console.log(contact.profile.role);            // "VP of Engineering"
console.log(contact.company.name);            // "Acme Corp"
console.log(contact.identifiers.linkedin_url);
console.log(contact.profile.about);           // written summary
console.log(contact.next.action);             // recommended next step
Input fieldRequiredDescription
emailone ofEmail to resolve
linkedin_urlone ofLinkedIn URL to resolve

nd.context(input, options?)

Get relationship context — full interaction history across all agents, open follow-ups, and recommended next step.

const { context } = await nd.context(
  { contact: 'jane@acme.com' },
  { agent: 'research-bot' },
);

console.log(context.relationship_summary);
console.log(context.recent_interactions);
// [{ channel, occurred_at, summary, details }, ...];
console.log(context.open_followups);
// [{ id, action, due }, ...];
console.log(context.recommended_next_action);

nd.record(input, options?)

Record an interaction after outreach. Pass agent in options so history is attributed.

await nd.record(
  {
    contact: 'jane@acme.com',
    channel: 'email',
    direction: 'outbound',
    summary: 'Sent intro about partnership',
  },
  { agent: 'sales-bot' },
);
FieldRequiredValues
contactyesEmail or contact ID
channelyesemail call linkedin slack meeting sms other
directionyesinbound outbound
summaryyesWhat happened

nd.followup(input, options?)

await nd.followup(
  {
    contact: 'jane@acme.com',
    action: 'Follow up in 3 days',
    due: '2026-07-25',
  },
  { agent: 'sales-bot' },
);

Error handling

import { Nondual, NondualError } from 'nondual';

try {
  const { contact } = await nd.resolve({ email });
} catch (err) {
  if (err instanceof NondualError) {
    console.error(err.status, err.message);
  }
}