private.me
Get LangChain-xLink
QUICKSTART GUIDE
LangChain + xLink

Identity-Based Auth in 5 Minutes

Add cryptographic identity to your LangChain agents. Replace API keys with verifiable M2M authentication. Zero configuration, zero cascading failures.

603× faster than OAuth
0.36ms auth overhead
Zero cascading failures

Installation

Install the LangChain-xLink integration package via npm:

Terminal
# Install the integration package
npm install @private.me/langchain-xlink

# Or with yarn
yarn add @private.me/langchain-xlink

Add Identity to Your Agent

Replace API key authentication with xLink identity. Three lines of code:

TypeScript
import { LangChainXLinkAgent } from '@private.me/langchain-xlink'
import { OpenAI } from 'langchain/llms/openai'
import { HNSWLib } from 'langchain/vectorstores/hnswlib'

// Create agent with identity
const agent = await LangChainXLinkAgent.quickstart()

// Connect to vector store with identity (no API keys)
const vectorStore = await agent.connect('did:xlink:vectorstore-production')

// Send authenticated request
await agent.send({
  to: vectorStore,
  type: 'similarity_search',
  payload: { query: 'user authentication patterns', k: 5 }
})

Benefits

What you get by replacing API keys with xLink identity:

603× Faster
91ms vs 54,853ms for token refresh. No OAuth roundtrips, no token expiry.
🔒
Zero Cascading Failures
One expired token can't restart 500 agents. Identity never expires.
⏱️
0.36ms Auth Overhead
HMAC-based verification. 2,778× faster than JWT signature verification.
🚫
No API Keys
No credentials in .env files. No rotation. No leaks.
🔄
Forward Secrecy
Every message uses ephemeral keys. Compromised key reveals nothing.
📊
Built-in Audit
Every message cryptographically signed. Complete audit trail.

Learn More