Publishing from Obsidian to Lorewoven

This guide is for technical users. It involves running a Node.js script from the command line, editing JSON config files, and using curl. If any of that sounds unfamiliar, that is completely fine — Lorewoven works perfectly well without it. This is an optional power-user workflow for people who already live in Obsidian and want to cut out the copy-pasting.

If you want this but aren't there yet technically, bookmark it and come back. It will still be here.


A note on running scripts from the internet

You should never download and run a script you haven't read and understood. That advice applies to this one too.

Before running lw-publish.js, open it and read it. It is around 200 lines and does exactly three things: reads a markdown file, calls the Lorewoven API, and writes an ID back to your frontmatter. It does not touch anything else on your system. We believe it is safe — but "trust us, it's fine" is not a good reason to run arbitrary code. Verify it yourself. If you can't read it well enough to be confident, either find someone who can or don't run it.

The script is open source and hosted on GitHub. Read it there before you download anything.


If you already write in Obsidian, there is no reason to maintain two copies of your characters and stories. This guide walks you through a simple Node.js script that reads your Obsidian notes and publishes them directly to your Lorewoven account via the API. First run creates the entry. Every run after that updates it. Your frontmatter gets the ID written back automatically, so nothing ever duplicates.


Prerequisites


Step 1: Download the Script

Create a folder somewhere you can run scripts from — inside your vault works well. Download lw-publish.js from the Lorewoven GitHub repository:

https://github.com/Noval1th/Lorewoven/blob/main/tools/obsidian/lw-publish.js

Save it somewhere you'll remember, for example _tools/lw-publish.js inside your vault.

Open a terminal in that folder and install the two dependencies:

npm install gray-matter node-fetch@2

Step 2: Create Your Config File

In the same folder as lw-publish.js, create a file called lw-config.json:

{
  "lorewoven_url": "https://app.lorewoven.net",
  "lorewoven_token": "YOUR_TOKEN_HERE"
}

You'll replace YOUR_TOKEN_HERE in the next step.


Step 3: Get Your API Token

Your API token gives the script permission to create and update content on your behalf. Tokens last 10 years by default, so you only need to do this once.

Step 3a — Log in to get a short-lived token:

curl -s -X POST https://app.lorewoven.net/api/login \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"yourpassword"}'

Copy the token value from the response.

Step 3b — Exchange it for a long-lived token:

curl -s "https://app.lorewoven.net/api/token?ttl=3650d" \
  -H "Authorization: Bearer PASTE_TOKEN_HERE"

Copy the token value from this response and paste it into lw-config.json as lorewoven_token.

Keep this token private. It has full access to your account. Don't commit lw-config.json to a public repository.


Step 4: Set Up Your Notes

Add a small block of frontmatter to any Obsidian note you want to publish. The script reads these fields to know what to create and where.

Character Note

---
title: Thalindra Dawnwhisper
lw-type: character
lw-character-id:
lw-game: World of Warcraft
lw-race: Blood Elf
lw-class: Paladin
lw-image-url:
lw-public: true
lw-status:
lw-last-synced:
---

Your character's backstory goes here. Everything below the frontmatter
becomes the backstory field on Lorewoven. Markdown is supported.

Story Note

---
title: The Silence After Tempest Keep
lw-type: story
lw-character-id: 42
lw-story-id:
lw-story-date: 2026-03-17
lw-tags: blood elf, regret, tempest keep
lw-private: false
lw-status:
lw-last-synced:
---

The story content goes here. Everything below the frontmatter becomes
the story body on Lorewoven.

Note: For stories, lw-character-id must already exist. Create the character first, then copy its ID into your story notes.


Step 5: Publish

From the folder containing lw-publish.js, run:

node lw-publish.js path/to/your/note.md

On first run the script creates the entry on Lorewoven and writes the returned ID back into the note's frontmatter. Run the same command again at any time to push your latest edits.

Creating character "Thalindra Dawnwhisper"...
✓ Created: https://app.lorewoven.net/characters/42
✓ Frontmatter updated (lw-last-synced: 2026-03-17)

Frontmatter Reference

Character Fields

Field Required Description
title Yes Becomes the character name on Lorewoven
lw-type Yes Must be character
lw-character-id Auto Filled in after first publish
lw-game Yes e.g. World of Warcraft, D&D 5e, Skyrim
lw-race No e.g. Blood Elf, Human
lw-class No e.g. Paladin, Rogue
lw-image-url No Direct link to a character image
lw-public No true to make the character visible in the gallery. Default false

Story Fields

Field Required Description
title Yes Story title
lw-type Yes Must be story
lw-character-id Yes ID of the character this story belongs to
lw-story-id Auto Filled in after first publish
lw-story-date Yes When the story happened. Format: YYYY-MM-DD
lw-tags No Comma-separated. e.g. combat, ironforge, loss
lw-private No true to hide from public view. Default false

Tips

  • Publish the character first. Stories need a lw-character-id, which only exists after the character has been created.
  • Quote dates in frontmatter. Use lw-story-date: "2026-03-17" (with quotes) to prevent YAML from converting it to a timestamp object. The script handles both, but quotes keep your notes cleaner.
  • Use --dry-run to preview. Running node lw-publish.js note.md --dry-run prints the payload without making any API calls. Useful for checking that your frontmatter is wired up correctly before publishing.
  • The script is idempotent. Running it ten times on the same note is safe — it creates once, then updates.

Supported Games

Any game name is accepted. These are the ones with dedicated gallery filters on Lorewoven:

  • World of Warcraft
  • D&D 5e
  • Skyrim
  • Albion Online
  • Mount & Blade II: Bannerlord
  • Other