Vite Installation
Last updated
Last updated
This guide will help you integrate the Squid Widget into your Vite + TypeScript project.
For a complete working example, check out our .
Ensure you have the following installed:
Node.js
Yarn or npm
Git (for cloning the example repository)
First, install the Squid Widget and necessary dependencies:
Squid requires some polyfills for browser compatibility. Follow these steps to add them:
Install the vite-plugin-node-polyfills
plugin:
Update your vite.config.ts
file:
Add the Squid Widget to your desired component. For example, in src/App.tsx
:
Replace <your-integrator-id>
with the Integrator ID you received from Squid.
After setting up the widget, you can start your Vite development server:
For a full working example, you can clone our example repository:
To customize the widget's appearance and behavior:
Copy the generated config and paste it into your config
prop in the SquidWidget
component.
If you encounter any issues:
Ensure you're using the latest version of the widget (^3.0.10).
Verify that you've correctly configured the vite.config.ts
file with the polyfills.
Check that you've added the correct integratorId
and apiUrl
in the widget config.
Make sure all dependencies are properly installed.
Use the to generate a custom configuration.