Skip to main content

Overview

salesive-dev-tools is a powerful CLI tool and Vite plugin for building and managing Salesive templates.
  • CLI commands for project initialization, authentication, validation, and deployment to Salesive Themes API.
  • Vite plugin that injects configuration from salesive.config.json as CSS variables and a global object.
  • React hooks for accessing and dynamically updating configuration at runtime.
  • Template deployment with the salesive cook command for one-command packaging and upload.
Pair with salesive-api-axios for complete Store API integration.

Install the tooling

Add the package inside your project workspace:
For CLI access everywhere, install it globally:

Configure Vite

Register the plugin alongside your existing React configuration:

Define your Salesive config

Create a salesive.config.json file in the project root to describe brand assets, CSS tokens, and metadata the plugin should inject.
Configuration format: Variables use a flat structure with kebab-case keys. You need to manually inject CSS variables in your stylesheets as needed.

Declare supported store types

The optional shopTypes array tells Salesive which store types your theme is built for. A merchant can only install a theme on a store whose type is listed here.
The catalog endpoints (/products, /products/{id}, /cart, /orders) return a catalogType and per-item itemType that match the active store type, so a multi-type theme can branch on those fields. If shopTypes is omitted it defaults to ["ecommerce"]. List every type your theme supports, e.g. ["ecommerce", "restaurant", "business"].

Override an automatic route

By default, automatic routes such as /cart, /checkout, and /blog render with Salesive’s built-in theme. The optional routeOverrides array lets your theme take over specific automatic routes and render them itself:
Each value must be one of the automatic routes, otherwise the theme upload is rejected. Declaring a base path overrides its whole subtree (/blog also covers /blog/my-post), and you become responsible for implementing that route in your app with React Router. Leave the array empty (or omit it) to keep every automatic route on the platform default. See Overriding an automatic route for the full behavior.

Consume configuration in React

Use useSalesiveConfig() to read values anywhere in your component tree:

Apply updates at runtime

The toolkit ships with stateful helpers for mutating configuration without reloading the page.

Router-aware branding

Pair the helpers with React Router to switch themes per route.

Helper access outside React

When you need configuration data in non-component code, use getSalesiveConfig().

Injected assets

The plugin automatically handles:
  • Document title – sourced from variables.app-name.
  • Meta description – written from variables.app-description.
  • Favicon – linked using variables.app-favicon.
  • Global runtime object – exposed as window.SALESIVE_CONFIG for direct inspection.
Development mode only: The plugin runs during vite dev and is automatically disabled for production builds.

Using CSS variables

To use configuration values as CSS custom properties, manually inject them in your stylesheets:
Or apply them dynamically using the React hook:

Command-line workflows

Install globally to unlock the salesive CLI for daily workflows.

Authenticate with Themes API

The API key must have the “Read & Write Themes” permission (WRITE_THEMES). This is the permission salesive cook uses to publish and update your theme — without it, deploys are rejected with a permissions error. When you generate the API key in your Salesive dashboard, enable Read & Write Themes before setting the token with salesive auth set-token.

Create projects

Develop locally

Validate configuration

Validation checks: required fields (name, version, description), name format (lowercase, hyphens only), semantic versioning, and variables structure.

Deploy templates

The cook command packages and deploys your template to the Salesive Themes API.
cook uploads through the Themes API, so the authenticated API key must have the Read & Write Themes (WRITE_THEMES) permission. See Authenticate with Themes API.
What gets deployed:
  • All template files (HTML, CSS, JS, images, etc.)
  • salesive.config.json (required)
  • salesive.form.json (optional)
Automatic exclusions:
  • node_modules/, .git/, .salesive-temp/, *.log, .DS_Store

CLI reference tables

Cook (Deploy) options

Auth options

Init options

Validate options

Integrate with Store API

Combine salesive-dev-tools with salesive-api-axios for complete Store API integration:

Auto-update notifications

The CLI automatically checks for updates once every 24 hours and notifies you when a new version is available:

License

Released under the MIT license.