gleap-sdk-setup
Original:🇺🇸 English
Translated
1 scriptsChecked / no sensitive code detected
Integrates the Gleap customer feedback SDK into projects. Detects the platform (JavaScript, iOS, Android, React Native, Flutter, Ionic Capacitor, Cordova, FlutterFlow) and guides through installation, initialization, permissions, and common API usage like user identification and event tracking. Use when adding Gleap, setting up feedback SDK, or integrating Gleap SDK.
2installs
Sourcegleapsdk/agent-skills
Added on
NPX Install
npx skill4agent add gleapsdk/agent-skills gleap-sdk-setupTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Gleap SDK Setup
Guides users through integrating the Gleap SDK into their project. Supports JavaScript, iOS, Android, React Native, Flutter, Ionic/Capacitor, Cordova, and FlutterFlow.
Platform Detection
Detect the user's platform before proceeding. If the user explicitly states their platform, skip detection.
Auto-Detection Priority
Check in this order (first match wins):
-
exists?
pubspec.yaml- Contains references or user mentions FlutterFlow -> FlutterFlow (
flutterflow)platform-flutterflow.md - Otherwise -> Flutter ()
platform-flutter.md
- Contains
-
exists? Read it and check
package.json+dependencies:devDependencies- present -> React Native (
react-native)platform-react-native.md - or
@capacitor/corepresent -> Ionic/Capacitor (capacitor-core)platform-ionic-capacitor.md - present, or
cordovaexists withconfig.xml-> Cordova (<widget>)platform-cordova.md - present -> JavaScript (Angular)
@angular/core - present (without
react) -> JavaScript (React)react-native - present -> JavaScript (Vue)
vue - present -> JavaScript (Next.js)
next - present -> JavaScript (Nuxt)
nuxt - Other or no framework -> JavaScript (generic npm)
- Use for all JavaScript variants
platform-javascript.md
-
,
*.xcodeproj, or*.xcworkspaceexists? -> iOS (Podfile)platform-ios.md -
,
build.gradle, orbuild.gradle.ktsexists? -> Android (app/build.gradle)platform-android.md -
exists (no
index.html)? -> JavaScript CDN approach (package.json)platform-javascript.md -
Server-side web framework detected? These all use the JavaScript SDK on the client side ():
platform-javascript.md- exists (PHP / Laravel) — use CDN or npm depending on whether a JS build pipeline exists
composer.json - with
Gemfile(Ruby on Rails) — use CDN in layouts, or npm if Webpacker/esbuild/importmap is presentrails - /
requirements.txtwithpyproject.tomlordjango(Python) — use CDN in base templatesflask - /
*.cshtmlfiles (.NET / ASP.NET) — use CDN in layout views*.csproj - /
pom.xmlwith Spring Boot (Java) — use CDN in Thymeleaf templatesbuild.gradle - Any other web framework (Go, Elixir/Phoenix, etc.) — use CDN approach
- Note: If the project also has a with a frontend framework, step 2 already covers this.
package.json
-
Nothing detected -> Ask the user which platform they are targeting.
Detection Commands
Use to scan for key files:
Globpubspec.yamlpackage.json**/*.xcodeproj**/*.xcworkspacePodfilebuild.gradlebuild.gradle.ktsapp/build.gradleconfig.xmlindex.htmlcomposer.jsonGemfilerequirements.txtpyproject.toml
If is found, use to inspect its and keys.
package.jsonReaddependenciesdevDependenciesAPI Key Resolution
Before asking the user for their API key, check these locations in order:
- User provided it in the conversation (e.g., "add Gleap with token abc123") — use it directly
- file in the project root — look for
.envGLEAP_API_KEY=... - Environment variable — check if is set via
GLEAP_API_KEYecho $GLEAP_API_KEY - Not found — ask the user to provide their API key (available at https://app.gleap.io under Project Settings > Security > API Key)
When a key is found or provided, offer to save it to the project's file (creating it if needed, and adding to if not already there) so it's available for future use.
.env.env.gitignoreWorkflow
Follow these steps in order:
- Fetch latest SDK versions: Run from this skill's directory. Use the returned versions in all install commands instead of hardcoded version numbers.
scripts/get-latest-versions.sh - Detect platform using the priority rules above.
- Resolve API key using the API Key Resolution steps above.
- Confirm with user: State the detected platform and ask for confirmation. If the user already specified a platform, skip this step.
- Read platform guide: Read the matching file from this skill's directory.
platform-{name}.md - Install SDK: Walk the user through installing the dependency using the latest version from step 1. Run install commands when the user approves. Verify installation succeeded.
- Initialize SDK: Add initialization code using the resolved API key.
- Configure platform: Apply required permissions, manifest entries, or additional config from the platform guide.
- Verify: Suggest building/running the project to confirm integration works.
Post-Setup API Guidance
After setup, if the user asks about using the Gleap API, refer to the "Common API Usage" section in the relevant platform file. The most common tasks are:
- Identify users: Associate sessions with user data (name, email, plan, custom data)
- Track events: Log custom events at key points in the app
- Custom data: Attach contextual data to feedback tickets
- Widget control: Programmatically open/close the Gleap widget
Re-read the platform file's API section for the correct method signatures, as they differ between platforms.
Important Notes
- must be called exactly once in the application lifecycle
initialize() - For cross-platform frameworks (React Native, Flutter, Ionic/Capacitor), both iOS and Android platform-specific configuration (permissions) is needed
- The JavaScript CDN approach works for any web context and does not require npm
- For identity verification, the user hash must be generated server-side using the project's secret key
- Custom data supports only primitive values (strings, numbers, booleans) with a max of 35 keys
Common Troubleshooting
- fails: Run
pod installfirst, then retrypod repo update - Gradle sync fails: Ensure is at least 21
minSdkVersion - Flutter version conflict: Add to AndroidManifest.xml
tools:overrideLibrary="io.gleap.gleap_sdk" - Widget not showing on web: Check Content Security Policy headers allow
sdk.gleap.io - Soft-reload clears widget (Rails/Turbo): Call after reload
Gleap.getInstance().softReInitialize() - Android hardware acceleration: Do not set at application level
android:hardwareAccelerated="false"