Getting Started
Welcome to LeftUnread! This guide will help you create your first interactive messaging-based scenario.
What is LeftUnread?
LeftUnread is a platform for creating immersive, interactive scenarios that unfold through realistic messaging conversations. Players receive messages from characters, make choices, and influence the narrative in real-time.
Prerequisites
Before you begin, make sure you have:
- Node.js (v16 or higher) installed - Download here
- A code editor - We recommend Visual Studio Code (free)
- Basic understanding of JSON
- Familiarity with narrative writing
- (Optional) Knowledge of the Ink scripting language
Recommended Setup
Visual Studio Code with the Ink extension provides:
- Syntax highlighting for
.inkfiles - Auto-completion
- Error detection while you write
- Easy file navigation
To install:
- Download VS Code
- Open VS Code
- Click the Extensions icon (or press
Ctrl+Shift+X/Cmd+Shift+X) - Search for "Ink" by inkle
- Click Install
Quick Start
1. Create Your Project from Template
The easiest way to start is by using the GitHub template:
- Go to the LeftUnread Scenario Example Repository
- Click the green "Use this template" button (top right)
- Click "Create a new repository"
- Give your repository a name (e.g.,
my-leftunread-scenario) - Choose if you want it public or private
- Click "Create repository"
Now clone your new repository to your computer:
git clone https://github.com/YOUR-USERNAME/your-repository-name.git
cd your-repository-name(Replace YOUR-USERNAME and your-repository-name with your actual GitHub username and repository name)
2. Configure npm for GitHub Packages
Before installing dependencies, you need to set up authentication for GitHub Packages. Create a .npmrc file in your project root:
touch .npmrcOpen .npmrc in a text editor and add the following:
@LeftUnread:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR AUTH TOKENReplace YOUR AUTH TOKEN with your GitHub Personal Access Token (PAT). You can create a PAT at https://github.com/settings/tokens. Make sure it has the read:packages permission.
Security Note
Never commit your .npmrc file with your actual token to Git! The .npmrc file should be in your .gitignore. Consider using environment variables or npm config commands instead if you're working in a team.
3. Install Dependencies
npm install4. Explore the Project Structure
Your project should look like this:
leftunread-scenario-example/
├── src/
│ ├── assets/ # Images and media files
│ ├── contacts/ # Contact definitions (JSON)
│ ├── conversations/ # Conversation configurations (JSON)
│ └── ink/ # Ink script files (.ink)
├── scripts/
│ ├── build-scenario.cjs # Build script
│ └── publish-scenario.cjs # Publish script
├── .env.example # Environment variables template
└── package.json5. Build Your Scenario
Compile your Ink scripts and package your scenario:
npm run build:scenarioThis will:
- Compile all
.inkfiles to JSON - Copy assets to the build directory
- Generate a manifest
- Create a
dist/scenario-build.zipfile
6. Test Your Scenario Locally (Optional)
You can run your scenario in a browser for local testing:
npm run run:scenarioThis will:
- Start a local development server
- Open your scenario in your browser at
https://localhost:3000 - Automatically deploy changes when you save files
- Allow you to test your scenario interactively
Testing Workflow
- Edit your scenario files (
src/ink/*.ink,src/contacts/*.json, etc.) - Save your changes
- Refresh your browser or restart the scenario to see updates
- Test the conversation flow and player choices
- When satisfied, build and publish with
npm run build:scenarioandnpm run publish:scenario
::: note Restart Required After making changes to your scenario, you'll need to restart the scenario in the browser to see updates. The changes are deployed automatically, but the scenario session needs to be restarted. :::
7. Configure Publishing (Optional)
To publish your scenario to the LeftUnread server, you'll need to set up your credentials.
Step 1: Create Your Scenario
- Go to the Scenarios Management Page
- Click "Create New Scenario" or similar button
- Fill in your scenario details (name, description, etc.)
- After creation, copy the UUID from the URL in your browser's address bar
- Example:
https://leftunread.app/authors/test/scenarios/abc123-def456-... - The UUID is the long string of letters and numbers at the end
- This is your
SCENARIO_ID
- Example:
Step 2: Get Your API Key
- Go to the Manage Passport Tokens Page
- Create a new API token (or use an existing one)
- Copy the API key - you won't be able to see it again!
- This is your
API_KEY
Step 3: Configure Your Environment
In your project folder, copy
.env.exampleto.env:bashcp .env.example .envOpen
.envin a text editor and fill in your details:envBASE_URL=https://leftunread.app SCENARIO_ID=your-uuid-from-step-1 API_KEY=your-api-key-from-step-2Save the file
Step 4: Publish Your Scenario
Now you can publish:
npm run publish:scenarioFor Non-Technical Users
Don't worry if this seems complicated! Here's the simple version:
- Create your scenario on the website and copy the ID from the URL
- Get an API key from the tokens page
- Put both into the
.envfile - Run the publish command
Understanding the Template Scenario
The template includes "The Missing Friend" - a mystery scenario where the player helps find a missing person named Sarah. This serves as a complete working example you can learn from and modify.
Key Components
Contacts (src/contacts/*.json):
- Character profiles with names, avatars, and phone numbers
Conversations (src/conversations/*.json):
- Conversation configurations linking contacts to Ink scripts
- Defines conversation types (individual or group)
Ink Scripts (src/ink/*.ink):
- The actual narrative content and branching logic
- Player choices and character responses
Assets (src/assets/):
- Character avatars and images used in the scenario
Next Steps
Now that you have the basics:
- Understand the Project Structure - Learn about each file and folder
- Learn Ink Scripting - Master the narrative scripting language
- Build and Publish - Deploy your scenario to production
Tips for Beginners
Start Small
Begin with a simple conversation between two characters before creating complex branching narratives.
Test Frequently
Build and test your scenario often to catch errors early. The build script will show compilation errors.
Study the Example
The example scenario demonstrates many features - read through the Ink files to see how they work.
Getting Help
- Check the Ink documentation
- Review the example project files
- Look at the API reference for advanced features