
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
ainpcengine
Advanced tools
Official Node.js SDK for AINPCEngine - AI-powered NPC engine for games.
Create NPCs with real personalities, memories, and dynamic dialogue. Every NPC remembers, gossips, and reacts.
npm install @ainpcengine/nodejs-sdk
const AINPCEngine = require('@ainpcengine/nodejs-sdk');
const client = new AINPCEngine({
baseUrl: 'https://ainpcengine.com',
apiKey: 'YOUR_API_KEY', // Get one at https://ainpcengine.com
gameId: 'your-game-id',
});
// Talk to an NPC
const result = await client.say(npcId, 'player_1', 'I need a sword', {
location: 'blacksmith_shop',
timeOfDay: 'evening',
});
console.log(result.response.dialogue);
// Create
const npc = await client.createNPC({
name: 'Grok the Blacksmith',
personality: {
traits: ['gruff', 'honest'],
speechStyle: 'direct, no-nonsense',
backstory: 'Former soldier turned smith...',
values: ['family', 'hard work'],
},
role: 'merchant',
faction: 'ironforge',
});
// List all NPCs for your game
const npcs = await client.listNPCs();
// Get single NPC
const grok = await client.getNPC(npcId);
// Update
await client.updateNPC(npcId, {
location: 'market_square',
mood: { emotion: 'happy', intensity: 0.8 },
});
// Delete
await client.deleteNPC(npcId);
// Generate single NPC with full persona (OCEAN, schedule, psychology)
const npc = await client.generateNPC({ role: 'merchant' });
// Generate batch with social relationships
const { npcs, socialLinks } = await client.generateBatch({ count: 5 });
// Player dialogue
const result = await client.say(npcId, playerId, message, context);
// Player approaches NPC
const result = await client.approach(npcId, playerId, context);
// Player leaves NPC
const result = await client.leave(npcId, playerId, context);
// Trade request
const result = await client.requestTrade(npcId, playerId, context);
// NPC autonomy tick (hourly world simulation)
const result = await client.ambientTick(npcId, context);
// NPC gossip
const result = await client.gossip(npcId, context);
// Generic event (21 event types supported)
const result = await client.sendEvent(npcId, {
type: 'combat_started',
playerId,
context,
});
const context = {
location: 'blacksmith_shop',
timeOfDay: 'evening',
weather: 'rain',
nearbyNPCs: ['merchant_1'],
playerReputation: 75,
playerLevel: 5,
activeQuests: ['find_sword'],
recentEvents: ['helped_village'],
};
Sign up at ainpcengine.com to get your API key.
MIT - Copyright (c) 2026 Joe Wee / Tyga.Cloud Ltd.
FAQs
Node.js SDK for AINPCEngine - AI-powered NPC engine for games
The npm package ainpcengine receives a total of 8 weekly downloads. As such, ainpcengine popularity was classified as not popular.
We found that ainpcengine demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.