Documentation
Everything you need to integrate NeuraNPC. Most developers are up and running in an afternoon.
1Quick Start
Get started with NeuraNPC in minutes. Install the SDK, configure your API key, and create your first NPC.
npm install @neuranpc/sdk
# or with yarn
yarn add @neuranpc/sdk2Installation
NeuraNPC supports JavaScript/TypeScript, Unity, and Unreal Engine. Choose your platform:
JavaScript/TS
npm, yarn, pnpm
Unity
Coming Soon
Unreal
Coming Soon
3Your First NPC
Create an NPC with personality and start a conversation:
import { createNPC } from '@neuranpc/sdk';
// Initialize your NPC
const innkeeper = createNPC({
apiKey: process.env.NEURANPC_API_KEY,
name: 'Mira',
personality: {
traits: ['friendly', 'helpful', 'curious'],
backstory: 'A warm innkeeper who runs the Golden Flagon tavern.',
speechStyle: 'warm and welcoming, slight medieval tone'
}
});
// Start a conversation
const playerId = 'player-123';
const response = await innkeeper.chat(
"Hello! Is there a room available?",
playerId
);
console.log(response.message);
// "Welcome to the Golden Flagon, traveler! Of course we have rooms..."
console.log(response.emotion);
// "friendly"
console.log(response.memories);
// ["Player is looking for a room", "First interaction"]How It Works
NeuraNPC uses a cloud-based AI engine to generate contextual, personality-driven responses in real-time.
SDK Overview
The SDK handles connection, authentication, and conversation management. Here's what you can do:
Chat Management
Send messages, receive responses with emotion and context.
Memory Access
View, edit, or inject memories into NPC context.
Emotion Detection
Get real-time emotion state to drive animations.
Multi-NPC Support
Manage multiple NPCs with shared world context.
Memory System
NPCs automatically extract and store relevant information from conversations. Access or modify memories programmatically:
// Get NPC's memories about a player
const memories = await npc.getMemories(playerId);
// Inject a memory (game events, quest updates, etc.)
await npc.addMemory(playerId, "Player defeated the dragon");
// Clear memories for testing
await npc.clearMemories(playerId);Personality Engine
Define rich personalities with traits, backstories, and speech patterns:
const grumpyBlacksmith = createNPC({
apiKey: process.env.NEURANPC_API_KEY,
name: 'Grumble',
personality: {
traits: ['grumpy', 'skilled', 'secretly kind'],
backstory: 'A master blacksmith who lost his apprentice to war.',
speechStyle: 'short sentences, gruff, occasional softness',
likes: ['quality craftsmanship', 'honest work'],
dislikes: ['small talk', 'lazy adventurers']
}
});Emotion Detection
Every response includes an emotion state you can use to drive character animations:
const response = await npc.chat("I stole from the merchant", playerId);
console.log(response.emotion); // "angry" or "disappointed"
// Use in your game
character.playAnimation(response.emotion);
character.setFacialExpression(response.emotion);Authentication
Authenticate with your API key. Keep it secure on the server side.
// Environment variable (recommended)
const npc = createNPC({
apiKey: process.env.NEURANPC_API_KEY,
// ...
});
// Or pass directly (development only)
const npc = createNPC({
apiKey: 'nnpc_live_xxxxxxxxxxxxx',
// ...
});Security Note: Never expose your API key in client-side code. Use a backend proxy for browser-based games.
Chat Endpoint
Direct REST API access for custom integrations:
curl -X POST https://api.neuranpc.com/v1/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"npcId": "npc_xxxxx",
"playerId": "player_123",
"message": "Hello, innkeeper!"
}'
# Response
{
"success": true,
"message": "Welcome, traveler! Looking for a room?",
"emotion": "friendly",
"memories": ["New visitor arrived"]
}NPC Management
Create, update, and manage NPCs via API:
// Create NPC
POST /api/npcs
{
"name": "Mira",
"personality": { ... }
}
// List NPCs
GET /api/npcs
// Update NPC
PUT /api/npcs/:id
{
"personality": { ... }
}
// Delete NPC
DELETE /api/npcs/:idIntegration Examples
See how NeuraNPC integrates with popular development environments

TypeScript SDK
Full IntelliSense support with typed configurations and autocomplete.

Unity Integration
Seamless dialogue management with the NeuraNPC SDK in Unity.
See It In Action

Natural Dialogue
NPCs respond naturally to player choices with context-aware dialogue.

Persistent Memory
NPCs remember player actions and reference them in future conversations.
Ready to Build?
Start building with NeuraNPC today. Get your API key and create your first NPC in minutes.