Skip to content

Installation

Learn how to install FeedbackSpark Javascript SDK on your website.

HTML Script Tag

Paste this code between the <head> and </head> on all the pages where you want to show the survey. The snippet loads the FeedbackSpark SDK asynchronously and initializes it with your API token. Replace API_TOKEN with your actual API token.

<script type="text/javascript">
(function (g, r, a, d, i, an) {
if (window['spark']) return;
g["_shq"] = d;
g[d] =
g[d] ||
function () {
(g[d].q = g[d].q || []).push(arguments);
};
i = r.getElementsByTagName("head")[0];
an = r.createElement("script");
an.id='_shq';
an.async = 1;
an.src = a;
i.appendChild(an);
})(window, document, "https://static.feedbackspark.com/spark.js" ,'spark');
spark('init', API_TOKEN);
spark('setUser', USER_ID); //optional
</script>

NPM/Yarn Package

npm install --save feedbackspark

Next in your application, as early as possible, initialize Gradian

import spark from "feedbackspark";
spark("init", API_TOKEN);