Go to production
Before you put your integration live, check the following.
Build and deploy
Build your project with npm run build and deploy the contents of the dist folder. Don't serve the project folder itself: its HTML files load the unbundled source files, which only work through the development server.
If your pages are not served from the root of your domain, set base: './' in your Vite configuration, as the examples do. The built pages then load their scripts and styles with relative paths, so they work from any folder.
The API token is public
Your API token is part of the JavaScript that visitors download, so anyone can read it. Use the token meant for your public configurator, never a personal or admin token, and keep real tokens out of version control.
Language and currency
Set the locale option to the language of the page, and currency and country when your shop sells in several markets. Use only locales that are enabled for your Expivi team: an unsupported locale makes loading the product fail. When you leave them out, the API uses the defaults of your Expivi account. See Configurator options.
Bundle size
The web components are bundled with your code, so registering them adds to your JavaScript:
- The SDK with the ui-kit and ui-composer components is about 460 kB gzipped.
- The form renderer, which the quote form needs, adds about 150 kB gzipped.
Vite warns about chunks larger than 500 kB when you build. That is expected with the SDK. To keep pages light, register only the component groups that a page uses. You can also load rarely used groups, such as the quote form, with a dynamic import() when they are needed.
The 3D viewer
The examples load the viewer from https://assets.expivi.net/viewer/latest/viewer.js. This URL always serves the latest viewer, so your page gets viewer updates without a new deployment of your site.
If your site has a Content Security Policy, allow scripts from assets.expivi.net and connections to the Expivi API host in your apiBaseUrl. Check your browser's developer tools for other hosts that the viewer and the API use for models, images and fonts.
Test with your real products
Test every product type you sell. In particular:
- Products with a 3D model, a 2D visualization, or images only: the visualizer shows what the product has.
- Bundles: shoppers add products, so check that your custom UI, such as the specifications, handles several products.
- Features that must be set up in Expivi: prices, the bill of materials, and the quote request. The examples show a message when a feature is not set up; do the same in your UI.