A survey on your site in one line
A Shadow DOM widget, ~35 KB gzipped. Compatible with any framework, any CMS, any landing page. No iframe.
A survey on your site in two lines of HTML
<!-- 1. Load the widget script -->
<script src="https://cdn.askyo.ru/widget.js" async></script>
<!-- 2. Drop in a container with the survey ID -->
<div data-askyo="nps-feedback-v3"></div> The JS API and its options
If you need more control, initialise the widget programmatically. Every option is optional except id.
<script>
window.Askyo = window.Askyo || { q: [] };
window.Askyo.q.push(['init', {
id: 'nps-feedback-v3',
theme: 'auto', // 'light' | 'dark' | 'auto'
locale: 'en',
position: 'bottom-right', // or 'inline'
trigger: 'exitIntent', // or 'manual' | 'time:30s' | 'scroll:60%'
closable: true,
persist: 'session', // 'session' | 'local' | 'none'
variables: {
userId: 'user-42',
plan: 'pro',
utmSource: location.search,
},
onLoad: () => console.log('Widget loaded'),
onOpen: () => analytics.track('Survey opened'),
onSubmit: (data) => analytics.track('Survey submitted', data),
onClose: () => console.log('Closed'),
}]);
</script>
<script src="https://cdn.askyo.ru/widget.js" async></script> Configuration options
idThe survey ID from the editor. Required.theme'light' · 'dark' · 'auto': follows prefers-color-scheme. Defaults to 'auto'.locale'en' · 'ru' · 'kk'. Detected from navigator.language by default.position'bottom-right' · 'bottom-left' · 'center' · 'inline'.trigger'manual' · 'time:30s' · 'scroll:60%' · 'exitIntent'.variablesAny object. It lands in the response and is available in survey logic as {{ var.userId }}.onLoadonOpenonSubmitonCloseLifecycle callbacks.Inline, programmatic launch, frameworks
Inline mode (inside the page)
<!-- inline mode: the widget stretches to the container width -->
<div data-askyo="onboarding-v2" data-position="inline" style="max-width: 640px"></div> Open from a button
// Open programmatically, from any button on your site
document.querySelector('#feedback-button').addEventListener('click', () => {
window.Askyo.open('nps-feedback-v3');
});
// Close
window.Askyo.close('nps-feedback-v3');
// Destroy the instance (full cleanup)
window.Askyo.destroy('nps-feedback-v3'); React / Next.js
// React: init inside useEffect so it does not duplicate on re-render
import { useEffect } from 'react';
export function Feedback() {
useEffect(() => {
if (!window.Askyo) return;
window.Askyo.init({
id: 'in-app-feedback',
trigger: 'manual',
variables: { userId: currentUser.id },
});
return () => window.Askyo.destroy('in-app-feedback');
}, []);
return <button onClick={() => window.Askyo.open('in-app-feedback')}>Give feedback</button>;
} Content Security Policy
Content-Security-Policy:
script-src 'self' https://cdn.askyo.ru;
connect-src 'self' https://api.askyo.ru;
frame-src 'self';
img-src 'self' data: https:; Common questions about the widget
Will the widget clash with my site styles?
No. The widget renders inside a Shadow DOM: our styles are isolated from yours and yours from ours. It is safe to embed alongside any CSS framework.
How large is the script?
Around 35 KB gzipped for the core runner. Extra modules (maps, file upload, CAPTCHA) load on demand.
Does the widget work without JavaScript?
The widget itself does not, because it is an interactive component. The public survey page, however, is server-rendered and indexable by search engines.
What about GDPR and cookie consent?
The widget sets no third-party cookies. You can set persist: "none" so it does not touch localStorage at all. For stricter requirements, see the self-hosted build on the pricing page.
Ready to embed a survey?
Build the survey in the visual editor and copy the generated snippet.