Developers: integrate the try-on
This section is for whoever maintains the store’s code. It covers the Provei install codes, the options for opening the try-on from your own button, the try-on’s JavaScript API, the events it fires, its CSS variables, and what to allow in a Content Security Policy (CSP).
For a standard install, the wizard on the Instalação (Installation) screen is all you need. See Install Provei in your store.
What’s in this section
Section titled “What’s in this section”| Page | What it’s for |
|---|---|
| Install modes | The code for each try-on and the three ways to place it on the page: automatic button, embedded in the page, and the store’s own button. |
| Room try-on loader | The recommended code for the furniture, flooring and wall try-on, which checks the account before loading. |
| Video Commerce code | The script that loads your published video showcases. |
| Try-on JavaScript API | Open and close the try-on from your own code. |
| Try-on events | Know when the try-on is ready, opens, closes, adds to cart or fails. |
| Customize with CSS | The CSS variables for the button and the window. |
| CSP and domains | The addresses a Content Security Policy must allow. |
| SPA and headless stores | How the try-on behaves on sites that change pages without reloading. |
API integration
Section titled “API integration”The public API reference is under review. For server-side integrations, contact suporte@provei.ai.
An API integration uses an API key from your account. Treat the key like a password: it stays on the store’s server only, never in the site code, the theme or apps. The try-on install code carries no key.
- To create, rotate and revoke keys, see Create and revoke API keys.
- To store keys safely, see Best practices for API keys and access.
Before you touch the code
Section titled “Before you touch the code”- Check the account ID. Every code uses your account ID, in the format
00000000-0000-4000-8000-000000000000. Copy the ready-made code from the Instalação screen instead of assembling it by hand. - Use one code per try-on. Each try-on active on the account has its own code. Don’t put codes from different accounts on the same page.
- Prefer the dashboard settings. Text, colors, button position, window format and custom CSS live in Experiência na loja (In-store experience). Changes there don’t require editing the theme.
Frequently asked questions
Does the install code need an API key?
No. The code that goes on the store's site carries no API key. Keys are only for systems that run on the store's server.
Does Provei have a public REST API?
The public API reference is under review. To integrate a server-side system with Provei, contact suporte@provei.ai.
Where do I start if I only want to install the try-on?
Use the wizard on the Instalação (Installation) screen in the dashboard. This section is for when you need more than the automatic button, such as your own button, events or CSS tweaks.