Website
Set up your website with Vygor
Add Vygor to your website using one of two approaches: Embed for a no-code drop-in widget, or the SDK for full programmatic control.
Embed
Drop a script tag onto any website — no build step required.
SDK
Integrate Vygor directly into your JavaScript or TypeScript app.
Embed
The embed is the fastest way to add Vygor to an existing site. Paste the snippet below before the closing </body> tag.
<script src="https://cdn.vygor.com/embed.js" data-key="YOUR_PUBLIC_KEY" async></script>The widget will mount automatically once the script loads. You can customize its behavior using data- attributes:
| Attribute | Description |
|---|---|
data-key | Your public API key (required) |
data-theme | light or dark (default: light) |
data-position | bottom-right, bottom-left (default: bottom-right) |
SDK
Use the SDK when you need to trigger Vygor programmatically or integrate it into a React, Next.js, or other JS framework.
Install
npm install @vygor/sdkInitialize
import { Vygor } from '@vygor/sdk';
const vygor = new Vygor({ apiKey: 'YOUR_PUBLIC_KEY' });Usage
// Open the widget manually
vygor.open();
// Pre-fill user data
vygor.identify({ name: 'Jane Doe', email: 'jane@example.com' });
// Listen for events
vygor.on('complete', (data) => {
console.log('Workflow complete', data);
});