JSPM

@crit-fumble/worldanvil

3.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q56793F
  • License MIT

Client SDK for World Anvil API - types and HTTP client for worldbuilding integration

Package Exports

  • @crit-fumble/worldanvil
  • @crit-fumble/worldanvil/client
  • @crit-fumble/worldanvil/types

Readme

@crit-fumble/worldanvil

Client SDK for the World Anvil Boromir API (v2).

Installation

npm install @crit-fumble/worldanvil

Usage

import { WorldAnvilClient } from '@crit-fumble/worldanvil'

const client = new WorldAnvilClient({
  applicationKey: process.env.WORLDANVIL_APP_KEY!,
  authToken: process.env.WORLDANVIL_AUTH_TOKEN!,
})

// Get current user identity
const user = await client.identity()
console.log(`Logged in as ${user.username}`)

// List user's worlds
const { entities: worlds } = await client.worlds.list()

// Get articles in a world
const { entities: articles } = await client.articles.listByWorld(worlds[0].id)

// List available RPG systems
const { entities: systems } = await client.rpgSystems.list()

API Coverage

Resource List Get Create Update Delete
Users - - - -
Worlds
Articles
Notebooks
Note Sections
Notes
Categories
Maps
Markers
Timelines
Histories
Images - - -
Secrets
RPG Systems - - -

Authentication

You need two keys to use the World Anvil API:

  1. Application Key - Obtained by registering as a developer
  2. User Auth Token - Generated from User API Tokens page

License

MIT