Gleap JavaScript SDK

15.2.8 · active · verified Sun Apr 19

The Gleap JavaScript SDK, currently at version 15.2.8, offers an AI-native platform for comprehensive customer support, feedback collection, and bug reporting within web applications. It integrates a range of features including an autonomous AI agent (Kai) designed for resolving customer inquiries and automating workflows, a built-in Help Center, outbound messaging, product roadmapping tools, and a unified multichannel inbox. The package maintains an active development pace with frequent minor releases, addressing features like video calling capabilities, improved platform/device detection, and updates to cookie management defaults. Its key differentiators lie in its holistic approach to customer engagement, extending beyond basic feedback forms to include advanced AI assistance and a full suite of support tools.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install, import, and initialize the Gleap SDK with an SDK token, including an example of user identification.

import Gleap from 'gleap';

// Replace 'YOUR_SDK_TOKEN' with your actual token from the Gleap dashboard.
// For production, consider using environment variables for security.
const SDK_TOKEN = process.env.GLEAP_SDK_TOKEN || 'YOUR_SDK_TOKEN_HERE';

if (SDK_TOKEN === 'YOUR_SDK_TOKEN_HERE') {
  console.warn('Gleap SDK: SDK_TOKEN is a placeholder. Please replace it with your actual token.');
}

try {
  Gleap.initialize(SDK_TOKEN);
  console.log('Gleap SDK initialized successfully.');
  
  // Example of identifying a user (optional, but common practice)
  Gleap.identify('user-123', {
    name: 'John Doe',
    email: 'john.doe@example.com',
    plan: 'premium'
  });

  // To open the Gleap widget programmatically (e.g., from a custom button)
  // Gleap.open();

} catch (error) {
  console.error('Failed to initialize Gleap SDK:', error);
}

view raw JSON →