Skip to main content

JavaScript

The Gleap SDK for JavaScript is the easiest way to integrate Gleap into your apps. Communicate with your users directly and build better software by discovering their everyday pain points. Gleap is your all-in-one customer feedback tool for apps and websites.

For the SDK to work, you need an API key, which you can get for free at app.gleap.io.

🏗 Installation

Installing the Gleap SDK takes only a few seconds. We do offer the following two installation methods.

Code snippet: This method always loads the latest version of Gleap and is suitable for all use cases.

npm / yarn: This method allows you to install the Gleap SDK locally and ship it together with your application. This method is usually used with frameworks like Angular, React or Vue.js.

Add the following code snippet to the <head>-tag of your website or web app. Replace API-KEY with your API key. The snippet below will load the Gleap widget asynchronously, to ensure it won't affect your page speed.

Code snippet

<script>
!function(Gleap,e,key){if(window.GleapActions=[],Gleap=window.Gleap=window.Gleap||[],!Gleap.invoked){for(Gleap.invoked=!0,Gleap.methods=['identify','clearIdentity','attachCustomData','setCustomData','removeCustomData','clearCustomData','registerCustomAction','logEvent','sendSilentBugReport','startFeedbackFlow','open','hide','on','setLanguage','initialize', 'setLiveSite'],Gleap.f=function(e){return function(){var a=Array.prototype.slice.call(arguments);window.GleapActions.push({e,a});};},e=0;e<Gleap.methods.length;e++)key=Gleap.methods[e],Gleap[key]=Gleap.f(key);Gleap.load=function(k){var b='https://gleapcdn.com/latest/';var h=document.getElementsByTagName('head')[0];var n=document.createElement('link');n.onload=function(){var t=document.createElement('script');t.type='text/javascript',t.async=!0,t.src=b+'index.js',h.appendChild(t);},n.rel='stylesheet',n.type='text/css',n.href=b+'index.min.css',n.media='all',h.appendChild(n);},Gleap.load(),
Gleap.initialize('API-KEY');
}}();
</script>
info

Congrats! You are now all set 🎉 Report your first bug by using the feedback button

🤝 Need help?

We are here to help! [email protected]