Configuration Methods
There are three primary ways to configure LiveCodes:Configuration Object
Pass a config object via the SDK or embed options
URL Query Parameters
Configure playgrounds using URL parameters
Runtime API
Modify configuration programmatically at runtime
Configuration Structure
The configuration object is divided into three main categories:Content Configuration
Defines the content of the current project:- Editors: Markup, style, and script editor content and languages
- External Resources: Stylesheets, scripts, and CSS presets
- Project Metadata: Title, description, tags
- Custom Settings: Language-specific and advanced settings
- Type Definitions: Custom TypeScript types for IntelliSense
- Tests: Test configuration and content
App Configuration
Controls how the app behaves:- Display Mode: Full, editor-only, result-only, lite, etc.
- View: Split, editor, or result view
- Tools: Console, compiled code viewer, tests
- Permissions: Read-only mode, language change restrictions
- Zoom: Result page zoom level
User Configuration
Defines user preferences and settings:- Auto-features: Auto-update, auto-save, auto-test
- Editor Settings: Theme, font, tab size, line numbers, etc.
- Formatter Settings: Code formatting preferences
- Layout: Horizontal, vertical, or responsive
- UI Language: App language preference
Configuration Precedence
When multiple configuration sources are present, they are applied in this order (later sources override earlier ones):Basic Example
URL Parameter Example
The same configuration can be achieved with URL parameters:Default Values
All configuration properties have sensible defaults:Content Defaults
Content Defaults
- title:
"Untitled Project" - markup:
{ language: "html", content: "" } - style:
{ language: "css", content: "" } - script:
{ language: "javascript", content: "" } - stylesheets:
[] - scripts:
[]
App Defaults
App Defaults
- mode:
"full" - view:
"split" - readonly:
false - allowLangChange:
true - tools:
{ enabled: "all", active: "", status: "" } - zoom:
1
User Defaults
User Defaults
- autoupdate:
true - autosave:
false - delay:
1500 - theme:
"dark" - tabSize:
2 - lineNumbers:
true - formatOnsave:
false
Configuration Validation
LiveCodes automatically validates and upgrades configuration objects:- Invalid values are replaced with defaults
- Old configuration formats are automatically upgraded
- Language aliases are resolved to canonical names
- Missing required properties are added
TypeScript Support
The SDK provides full TypeScript definitions for the configuration object:Next Steps
Configuration Object
Complete reference for all configuration options
Query Parameters
Learn how to configure via URL parameters
Editor Settings
Customize the code editor appearance and behavior
Custom Settings
Advanced language-specific configuration