Вільшанська сільська рада
Вільшанська сільська рада Житомирського району Житомирської області

Тестовий прихований розділ

Pulse Feedback Widget

This widget provides a simple way to collect user feedback within the Pulse application.

Pulse Feedback Widget Integration Guide

This guide explains how to integrate the Pulse Feedback Widget into your HTML page using different configuration methods.


Integration Methods

You can integrate the Pulse Feedback Widget into your application using one of the following methods. Each method allows you to configure the widget's API endpoint and completion URL.

Configuration from multiple sources priority order: data attributes > global object > meta tags > defaults

Default Configuration

If no configuration is provided, the widget uses these default values:

apiUrl: 'https://api.pulse.gov.ua/api/v2/feedback',
completeUrl: 'https://pulse.gov.ua/complete-feedback'
mediaFilesHost: 'https://pulse.gov.ua'
autoInit: true

Method 1: Script Tag with Data Attributes

Embed the widget directly with data- attributes to configure it.

<script
    src="https://pulse.gov.ua/assets/pulse-feedback-widget/pulse-feedback-widget.js"
    data-api-url="https://your-api.com/api/v2/feedback"
    data-complete-url="https://your-site.com/complete-feedback"
    data-media-files-host="https://your-site.com"
></script>

Example for Sandbox:

<script 
    src="https://pulse-sandbox.prozorro.sale/assets/pulse-feedback-widget/pulse-feedback-widget.js"
    data-api-url="https://api-pulse-sandbox.prozorro.sale/api/v2/feedback"
    data-complete-url="https://pulse-sandbox.prozorro.sale/complete-feedback"
    data-media-files-host="https://pulse-sandbox.prozorro.sale">
</script>

Method 2: Script Tag with Data Attributes

Define a global window.PulseFeedbackConfig object before loading the widget.

<script>
    window.PulseFeedbackConfig = {
        apiUrl: 'https://your-api.com/api/v2/feedback',
        completeUrl: 'https://your-site.com/complete-feedback',
        mediaFilesHost: 'https://your-site.com'
    };
</script>
<script src="https://pulse.gov.ua/assets/pulse-feedback-widget/pulse-feedback-widget.js"></script>

Example for Sandbox:

<script>
    window.PulseFeedbackConfig = {
        apiUrl: 'https://api-pulse-sandbox.prozorro.sale/api/v2/feedback',
        completeUrl: 'https://pulse-sandbox.prozorro.sale/complete-feedback'
        mediaFilesHost: 'https://pulse-sandbox.prozorro.sale'
    };
</script>
<script src="https://pulse-sandbox.prozorro.sale/assets/pulse-feedback-widget/pulse-feedback-widget.js"></script>

Method 3: Meta-Tags Configuration

Configure the widget via <meta> tags inside the <head>.

<head>
    <meta name="pulse-feedback-api-url" content="https://your-api.com/api/v2/feedback" />
    <meta name="pulse-feedback-complete-url" content="https://your-site.com/complete-feedback" />
    <meta name="pulse-feedback-media-files-host" content="https://your-site.com" />
    <script src="https://pulse.gov.ua/assets/pulse-feedback-widget/pulse-feedback-widget.js"></script>
</head>

Example for Sandbox:

<head>
    <meta name="pulse-feedback-api-url" content="https://api-pulse-sandbox.prozorro.sale/api/v2/feedback" />
    <meta name="pulse-feedback-complete-url" content="https://pulse-sandbox.prozorro.sale/complete-feedback" />
    <meta name="pulse-feedback-media-files-host" content="https://pulse-sandbox.prozorro.sale" />
    <script src="https://pulse-sandbox.prozorro.sale/assets/pulse-feedback-widget/pulse-feedback-widget.js"></script>
</head>

Method 4: Manual Initialization (Disable Auto-init)

Manually initialize the widget in JavaScript.

<script
    src="https://pulse.gov.ua/assets/pulse-feedback-widget/pulse-feedback-widget.js"
    data-auto-init="false"
></script>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        const widget = new pulseFeedbackWidget({
            apiUrl: 'https://your-api.com/api/v2/feedback',
            completeUrl: 'https://your-site.com/complete-feedback'
            mediaFilesHost: 'https://your-site.com'
        });

        window.pulseFeedbackWidget = widget;
    });
</script>

Example for Sandbox:

<script
    src="https://pulse-sandbox.prozorro.sale/assets/pulse-feedback-widget/pulse-feedback-widget.js"
    data-auto-init="false"
></script>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        const widget = new pulseFeedbackWidget({
            apiUrl: 'https://api-pulse-sandbox.prozorro.sale/api/v2/feedback',
            completeUrl: 'https://pulse-sandbox.prozorro.sale/complete-feedback'
            mediaFilesHost: 'https://pulse-sandbox.prozorro.sale'
        });

        window.pulseFeedbackWidget = widget;
    });
</script>

Public Methods

destroy();

Destroys the widget instance and removes all event listeners.

show();

Shows the widget if it is hidden.

hide();

Hides the widget if it is visible.

updateConfig(newConfig);

Updates the widget configuration dynamically. Accepts an object with new configuration values.

Код для вставки на сайт

Вхід для адміністратора

Онлайн-опитування:

Увага! З метою уникнення фальсифікацій Ви маєте підтвердити свій голос через E-Mail
Скасувати

Результати опитування

Дякуємо!

Ваш голос було зараховано

Форма подання електронного звернення


Авторизація в системі електронних звернень

Авторизація в системі електронних петицій

Ще не зареєстровані? Реєстрація

Реєстрація в системі електронних петицій

Зареєструватись можна буде лише після того, як громада підключить на сайт систему електронної ідентифікації. Наразі очікуємо підключення до ID.gov.ua. Вибачте за тимчасові незручності

Вже зареєстровані? Увійти

Відновлення забутого пароля

Згадали авторизаційні дані? Авторизуйтесь