{"id":18147,"library":"bard-legends-framework","title":"Bard Legends Framework","description":"Bard Legends Framework v1.4.0 enables rapid development of interactive text-based narratives with branching storylines and dynamic character management. Built on actions-lib ^3.2.1, helpers-lib ^2.1.1, and script-engine-lib ^1.1.1, it provides a plugin-based architecture for defining game actions, NPC behavior, and plot branching. Unlike generic game engines, it focuses on narrative-driven storytelling with minimal boilerplate.","status":"active","version":"1.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/sefabaser/Bard-Legends-Framework","tags":["javascript"],"install":[{"cmd":"npm install bard-legends-framework","lang":"bash","label":"npm"},{"cmd":"yarn add bard-legends-framework","lang":"bash","label":"yarn"},{"cmd":"pnpm add bard-legends-framework","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for defining and handling game actions and events.","package":"actions-lib","optional":false},{"reason":"Provides utility functions for state management, data processing, and common game mechanics.","package":"helpers-lib","optional":false},{"reason":"Script engine for executing custom narrative logic and branching conditions.","package":"script-engine-lib","optional":false}],"imports":[{"note":"Default export for the main framework class.","wrong":"import { BardLegends } from 'bard-legends-framework'","symbol":"BardLegends","correct":"import BardLegends from 'bard-legends-framework'"},{"note":"Named export from the plugins submodule since v1.3.0.","wrong":"import ActionPlugin from 'bard-legends-framework'","symbol":"ActionPlugin","correct":"import { ActionPlugin } from 'bard-legends-framework/plugins'"},{"note":"Named export from the main package (deprecated submodule path in v1.4.0).","wrong":"import NarrativeEngine from 'bard-legends-framework/narrative'","symbol":"NarrativeEngine","correct":"import { NarrativeEngine } from 'bard-legends-framework'"}],"quickstart":{"code":"import BardLegends from 'bard-legends-framework';\nimport { ActionPlugin } from 'bard-legends-framework/plugins';\n\nconst game = new BardLegends({\n  apiKey: process.env.LEGENDS_API_KEY ?? ''\n});\n\n// Define a custom action plugin\nclass GreetPlugin extends ActionPlugin {\n  constructor() {\n    super('greet');\n  }\n  execute(context) {\n    console.log(`Hello, ${context.player.name}!`);\n    return context;\n  }\n}\n\ngame.registerPlugin(new GreetPlugin());\n\ngame.start();","lang":"typescript","description":"Initializes a Bard Legends game instance, registers a custom action plugin that greets the player, and starts the narrative engine."},"warnings":[{"fix":"Update import to: import { NarrativeEngine } from 'bard-legends-framework';","message":"The import path for NarrativeEngine changed from 'bard-legends-framework/narrative' to 'bard-legends-framework' in v1.4.0.","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"Replace .plugins.add() with .registerPlugin().","message":"Legacy plugin registration using `game.plugins.add(plugin)` is deprecated; use `game.registerPlugin(plugin)` instead.","severity":"deprecated","affected_versions":">=1.3.0 <1.5.0"},{"fix":"Upgrade Node.js to version 16 or later.","message":"The framework requires Node.js >= 16.0.0 due to ESM-only distribution.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change import to: import { NarrativeEngine } from 'bard-legends-framework';","cause":"The NarrativeEngine module path was removed in v1.4.0.","error":"Error: Cannot find module 'bard-legends-framework/narrative'"},{"fix":"Use game.registerPlugin(plugin) instead of game.plugins.add(plugin).","cause":"The .plugins.add method was removed in v1.3.0 in favor of .registerPlugin().","error":"TypeError: game.plugins.add is not a function"},{"fix":"Use import syntax and ensure Node.js >= 16.","cause":"The package is ESM-only; using require() or an older Node version (< 16) causes this.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}