🏗 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.- Code snippet
- npm / yarn
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
Congrats! You are now all set 🎉 Report your first bug by using the feedback
button
🌍 Data region
Gleap stores and processes your data in the region you selected at signup: EU (default) or US. If your project lives in the US region, select the region before initializing the SDK (requires SDK v18.0.0 or newer). EU projects don’t need this call.window.Gleap.setRegion("us"); right before window.Gleap.initialize("API_KEY").
See Data regions for all hosts and details.
😵💫 Common pitfalls
Soft-reloading
Some application stacks clear all HTML & CSS while soft reloading (for example with Ruby on Rails). This results in the widget being removed. In order to re-initialize the widget, we recommend doing a soft re-initialization after the soft reload did take place.TypeScript errors after installing
The package ships type definitions for the<gleap-*> custom elements (for example <gleap-checklist> and <gleap-agent-conversation>) that work with both React 18 and React 19. This requires @types/react 18.2.6 or newer (17.0.51+ / 16.14.41+ on older React lines).
On older React typings you will see errors across your project right after installing, such as: