Overview
When developing with Overlayed locally, your application needs access to metadata about your app from the Overlayed platform. This guide explains how the.overlayed directory works and why it’s needed.
Setup
First-Time Setup
Authenticate with the CLI
Automatic Initialization
If you forget to runoverlayed init, the first time you run your application in development mode, Overlayed will:
- Detect that
.overlayed/meta.jsondoesn’t exist - Automatically fetch and cache the metadata
- Exit the application to load the cached data
- On the next run, your app will start normally
The .overlayed Directory
The .overlayed directory is created in your project root and contains cached metadata about your application. This
directory:
- Should be added to
.gitignore- It contains cached data that’s fetched from the API - Is automatically created - When you run
overlayed initor when your app first runs in development mode - Contains
meta.json- Your application’s metadata including ID, name, slug, and release information
What’s in meta.json?
The cached metadata file contains:
- Identify your application
- Configure the runtime environment
- Provide application context to your renderer processes
Troubleshooting
”Failed to fetch application metadata”
This error means:- You haven’t run
overlayed login, or - Your API key is invalid/expired, or
- Your
overlayed.config.tshas an incorrectapplicationId
overlayed login followed by overlayed init.
”Could not find overlayed instance”
This error in the renderer process means the preload script didn’t properly expose the Overlayed globals. Solution: Ensure you’re importing@overlayed/app/preload in your preload script.
