Narrative Design Keys
This guide shows how to dynamically pass variables to Narrative Design section and triggers

Narrative Design Keys
Last updated
Was this helpful?
Was this helpful?
//example
function getNarrativeTemplateKeys(): Map<string, string> {
const narrativeKeys = new Map<string, string>();
// Populate the map with narrative keys and values
// This could be from a database, configuration file, or other source
narrativeKeys.set('TimeOfDay', 'Replace it with time');
narrativeKeys.set('chapter1', 'The journey begins in a small village.');
// Add more narrative keys as needed
return narrativeKeys;
}
const client = new convaiClient({
apiKey: 'your-api-key',
characterId: 'your-character-id',
narrativeTemplateKeys: getNarrativeTemplateKeys()
});