MCPcopy Index your code
hub / github.com/MrPrimate/ddb-importer

github.com/MrPrimate/ddb-importer @7.3.15

Chat with this repo
repository ↗ · DeepWiki ↗ · release 7.3.15 ↗ · + Follow
10,061 symbols 18,879 edges 1,792 files 294 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

D&D Beyond Importer

Latest Release Download Count Forge Installs Foundry Minimum Compatible Version Foundry Verified Compatible Version

Integrate your dndbeyond.com characters into Foundry Virtual Tabletop.

This module: * Import your DDB characters into Foundry, and sync changes back! * Import a characters extras such as Wildshapes or beast companions. * Import spells and items. * Import Monsters and NPCs. * Patreon supporters can sync limited character changes back to DDB.

You can also:

  • Use the built in dictionary to get a large icon coverage during import.
  • Use supplied SRD items where available.
  • Choose to use matching SRD icons.
  • Attempt to auto-generate effects for items.

Video Tutorial

Watch a video to get started here!.

Documentation

See the documentation site

What's the catch?

Calls to dndbeyond are proxied to provide authentication and to bypass CORS checks.

The proxy calls dndbeyond with your credentials to fetch your data.

To get all your spells and do bulk importing you need to set the Cobalt Cookie setting to the value of your D&DBeyond CobaltSession cookie. See my helper Chrome extension to help.

Do NOT give your cookie to other people, this is like handing out a password to your dndbeyond account.

We do not store your cobalt cookie on the server.

To logout/invalidate these credentials log out of your D&DBeyond Session.

If you wish to host your own proxy, please see ddb-proxy, help is not available for this mode, and not all functionality is available.

Support

Where can you support me? See my Patreon.

You can log bugs here, or mention them in the Discord channel.

Pre-requisites and recommendations

There are NO pre-requisites for DDB Importer.

Below are some recommended modules.

I'd strongly recommend installing:

To learn more about automation visit the docs.

FAQ

See the FAQ!

Attributions

Some assets in this module are kindly provided by JB2A and are licensed by Attribution-NonCommercial-ShareAlike 4.0 International. You can find them under img/jb2a

Check them out at https://jb2a.com they have a free and patreon supported Foundry modules providing wonderful animations and assets for a variety of situations.

You can learn more about their Foundry modules here

DDB Importer Hook Events

The module emits the following Foundry hook events:

  • ddb-importer.preCreateTattooFromSpell

    • Fired before creating tattoo item data from a spell.
    • Returning false from any listener cancels tattoo creation.
    • Arguments:
      • spell: source spell document.
      • config: tattoo creation config object.
  • ddb-importer.createTattooFromSpell

    • Fired after tattoo data is created and before the item is returned.
    • Arguments:
      • spell: source spell document.
      • spellTattooData: final generated tattoo item data.
      • config: tattoo creation config object.
  • ddb-importer.compendiumCreationComplete

    • Fired after auto-compendium creation completes.
    • Payload:
      • { compendiums: string[] } compendium ids
  • ddb-importer.characterProcessDataComplete

    • Fired after character import processing completes.
    • Payload:
      • { actor, ddbCharacter }
  • ddb-importer.monsterAddToCompendiumComplete

    • Fired after a monster is added/updated in the target compendium.
    • Payload:
      • { actor }
  • ddb-importer.${type}CompendiumUpdateComplete

    • Fired when a compendium import run finishes for a given type.
    • Payload:
      • { results }
    • Known typed events include:
      • ddb-importer.spellsCompendiumUpdateComplete
      • ddb-importer.classCompendiumUpdateComplete
      • ddb-importer.summonsCompendiumUpdateComplete
      • ddb-importer.featuresCompendiumUpdateComplete
      • ddb-importer.vehiclesCompendiumUpdateComplete
      • ddb-importer.itemsCompendiumUpdateComplete

Example listener

Hooks.on("ddb-importer.characterProcessDataComplete", ({ actor, ddbCharacter }) => {
    console.log("Character import complete", actor?.name, ddbCharacter);
});

Extension points exported contracts — how you extend this code

I5eTableDDBImporterFlags (Interface)
ddb-importer's own table flags (foundry `flags.ddbimporter`).
src/types/system-5e-tables.d.ts
ICompendiumIndexEntry (Interface)
shape of the compendium index entries cached on CONFIG.DDBI.compendium.index.*
src/parser/lib/DDBReferenceLinker.ts
IFlagDocument (Interface)
the document whose ddb flags are shown/edited by this application
src/apps/DDBAdventureFlags.ts
IAdventureIndexEntry (Interface)
compendium index entry shape used by the adventure lookup maps
src/muncher/adventure.ts
IRestrictionMapping (Interface)
(no doc)
src/effects/restrictions.ts
IEdgeColorOptions (Interface)
(no doc)
src/lib/ImageEdgeColor.ts
ScanResult (Interface)
(no doc)
src/hooks/init/tokenizer2Frames.ts
ArmorType (Interface)
(no doc)
src/config/dictionary/items/equipment.ts

Core symbols most depended-on inside this repo

push
called by 1087
src/muncher/DDBMaps.ts
debug
called by 881
src/lib/Utils.ts
setProperty
called by 591
src/parser/DDBMonster.ts
getSetting
called by 552
src/lib/Utils.ts
overrideChange
called by 326
src/parser/enrichers/effects/ChangeHelper.ts
get
called by 315
src/muncher/DDBAdventures.ts
unsignedAddChange
called by 305
src/parser/enrichers/effects/ChangeHelper.ts
add
called by 233
tests/_setup/foundryMocks.ts

Shape

Method 5,596
Class 2,547
Function 1,020
Interface 898

Languages

TypeScript100%

Modules by API surface

src/effects/DDBEffectHelper.ts116 symbols
src/parser/DDBCharacter.ts114 symbols
src/parser/item/DDBItem.ts108 symbols
src/lib/DDBCompendiumFolders.ts94 symbols
src/types/system-5e-actor.d.ts85 symbols
src/types/ddb-character-source.d.ts85 symbols
src/parser/advancements/AdvancementHelper.ts72 symbols
src/updater/character.ts60 symbols
src/parser/enrichers/mixins/DDBEnricherFactoryMixin.ts59 symbols
src/lib/Utils.ts59 symbols
src/muncher/adventure/AdventureMunch.ts58 symbols
src/parser/monster/features/DDBMonsterFeature.ts55 symbols

For agents

$ claude mcp add ddb-importer \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact