salesive.config.json. This guide shows you how to access and use these variables in your theme.
Configuration File Structure
When a user submits your form, their data is saved tosalesive.config.json:
Variable Structure
All form field values are stored in thevariables object, using the field id as the key:
Accessing Variables
Salesive provides thesalesive-dev-tools package for accessing configuration variables in your React themes.
Installation
Install the package in your theme project:Setup
1. Configure Vite Plugin
Add the Salesive config plugin to yourvite.config.js:
The plugin automatically injects your config into the application during
development.
2. Create Configuration File
Yoursalesive.config.json file should be in the project root with variables from the form:
Using Variables in React Components
Using the React Hook
TheuseSalesiveConfig hook is the primary way to access variables in React components:
Getting All Variables
You can also retrieve all variables at once:Using in Non-Component Code
For accessing config outside of React components, use the helper function:Dynamic Configuration Updates
Update configuration values at runtime and all components will automatically re-render:All components using
useSalesiveConfig will automatically update when
configuration changes.CSS Variables
The plugin automatically injects all variables as CSS custom properties:Variable Types and Usage
Text Variables
Use text variables for content throughout your theme:Media Variables
Single Image
Multiple Images (Array)
Color Variables
Use color variables for theming:Select Variables
Single Select
Multi Select (Array)
Default Values
Always provide fallback values in case a variable is not set:Complete Example
Here’s a complete example showing how to use various variable types:- Form Schema
- Config Output
- Theme Usage
Best Practices
Variable Naming
- Use descriptive, semantic names:
heroTitleinstead oftitle1 - Follow camelCase convention:
primaryColor,phoneNumber - Be consistent across your entire theme
- Document which variables are required vs optional
Testing Variables
Development Testing
Create a testsalesive.config.json with sample data:
Production Validation
Before deploying your theme:- Test with minimal required variables only
- Test with all variables filled
- Test with very long text values
- Test with special characters in text fields
- Test with various image sizes and formats
- Test with all possible select option combinations
Variable Documentation
Document your theme’s variables in aREADME.md:
Next Steps
View Examples
See complete examples of form schemas and their usage
Schema Structure
Review the complete schema structure reference

