Simplio3D

Quick Start

Get up and running with the Simplio3D SDK in minutes.

1. Import the SDK

import { createSimplio3DClient } from '@simplio3d/sdk';

2. Initialize the Client

const client = createSimplio3DClient({
  apiUrl: 'https://your-project.supabase.co/functions/v1/make-server-0532dd87',
  accessToken: 'YOUR_ACCESS_TOKEN',
  timeout: 30000,
  retryAttempts: 3
});

3. Build a Headless Configurator

// Load project and all configurator data
const project = await client.getProject('proj_123');
// SDK normalizes large-project response variants:
// - project.sceneData (when available)
// - project.sceneDataCompressed + project.sceneDataEncoding (fallback)
const blocks = await client.getOptionBlocks('proj_123');
const pricingBlocks = await client.getPricingBlocks('proj_123');
const formFields = await client.getFormFields('proj_123');

// Evaluate conditional logic based on user selections
const visibility = await client.evaluateConditions('proj_123', {
  selections: {
    dropdownSelections: { 'blk_frame': 'black' },
    selectMaterialSelections: {},
    checkboxSelections: {},
    toggleSwitchSelections: { 'blk_armrests': 'with' },
    carouselSelections: {}
  }
});

// Calculate price (includes tax, formatting from project settings)
const price = await client.calculatePrice('proj_123', {
  selections: { /* same as above */ },
  variables: { width: 160 }
});

console.log('Total:', price.formatted);        // "$1,223.99"
console.log('Subtotal:', price.formattedSubtotal); // "$1,019.99"
console.log('Tax:', price.formattedTax, price.taxLabel); // "$204.00 VAT"

// Submit quote
const quote = await client.submitQuote('proj_123', {
  formData: { name: 'Jane', email: '[email protected]' },
  configuration: { selections: { /* ... */ }, variables: { width: 160 } }
});

Continue reading