Skip to main content

Prerequisites

  • Salesive account with shop credentials (shop ID and API key).
  • Node.js 18+ and a package manager (npm, yarn, pnpm, or bun).
  • Git repository for your Salesive storefront project.

Step 1 · Bootstrap your environment

# clone your project or initialize a new one
git clone <your-salesive-repo>
cd <your-salesive-repo>

# install dependencies
npm install

# install Salesive packages
npm install salesive-api-axios
npm install salesive-dev-tools --save-dev

# optional: install CLI globally for easier access
npm install -g salesive-dev-tools
Create a .env file with your Salesive credentials:
# Vite projects use VITE_ prefix
VITE_SALESIVE_SHOP_ID=your_shop_id
VITE_SALESIVE_API_KEY=your_api_key

# For Next.js, use NEXT_PUBLIC_ prefix
# NEXT_PUBLIC_SALESIVE_SHOP_ID=your_shop_id
# NEXT_PUBLIC_SALESIVE_API_KEY=your_api_key
Create salesive.config.json for template configuration:
{
    "name": "my-salesive-store",
    "version": "1.0.0",
    "description": "My Salesive storefront",
    "variables": {
        "color-brand-primary": "#0d65d9",
        "color-brand-primary-x": "#e6f6ff",
        "font-brand-space": "Space Grotesk",
        "app-name": "Salesive Store",
        "app-description": "Premium storefront powered by Salesive",
        "app-logo": "https://assets.salesive.com/logo.svg",
        "app-favicon": "https://assets.salesive.com/favicon.ico"
    }
}

Step 2 · Configure Vite and API client

Register the Salesive config plugin in vite.config.js:
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { salesiveConfigPlugin } from "salesive-dev-tools";

export default defineConfig({
    plugins: [react(), salesiveConfigPlugin()],
});
Use the API client in your components:
import { useEffect } from "react";
import { auth, cart, products } from "salesive-api-axios";
import { useSalesiveConfig } from "salesive-dev-tools";

function App() {
    const appName = useSalesiveConfig("app-name");
    const brandColor = useSalesiveConfig("color-brand-primary");

    useEffect(() => {
        // Fetch products from the Store API
        const loadProducts = async () => {
            const { data } = await products.list({ limit: 10 });
            console.log(data);
        };
        loadProducts();
    }, []);

    return (
        <div style={{ color: brandColor }}>
            <h1>{appName}</h1>
        </div>
    );
}

Step 3 · Authenticate with CLI (for deployment)

# authenticate with Salesive Themes API
salesive auth set-token

# verify authentication
salesive auth status

Step 4 · Run the local stack

# start your Vite dev server
npm run dev

# or use salesive CLI for config-watching
salesive dev --config ./salesive.config.json
Visit the dev server (default http://localhost:5173) to interact with your storefront. The Vite plugin automatically injects configuration from salesive.config.json into window.SALESIVE_CONFIG and makes it available via React hooks.

Step 5 · Validate and deploy

# validate your configuration
salesive validate

# deploy your template to Salesive Themes API
salesive cook

# or specify custom paths
salesive cook --path ./my-template --config ./salesive.config.json

# keep temp files for debugging
salesive cook --keep-temp --verbose
The cook command packages all template files, validates the configuration, and uploads to the Salesive Themes API. Monitor deployment status from your Salesive dashboard.
Tip: Run salesive validate before salesive cook to catch configuration errors early.

Next steps

Need support? Email [email protected] or reach out via your Salesive onboarding channel.