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/worldanvilUsage
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:
- Application Key - Obtained by registering as a developer
- User Auth Token - Generated from User API Tokens page
License
MIT