Skip to content

feat: Gleap.initialize(projectId) naming; version 19.5.0 - #71

Merged
boehlerlukas merged 3 commits into
mainfrom
feat/project-id-name
Nov 7, 2026
Merged

boehlerlukas merged 3 commits into
mainfrom
feat/project-id-name

Conversation

@boehlerlukas

@boehlerlukas boehlerlukas commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Implements the Project ID naming contract for React Native. The key Gleap.initialize takes is now called Project ID (formerly "SDK key" / "API key"). The value is the same, so every existing key keeps working.

API

  • Gleap.initialize(projectId: string). The positional value is unchanged, so Gleap.initialize('...') calls keep working as they are. Only the typing/JSDoc parameter name changes (formerly token).
  • No runtime warnings.

Native SDK PRs

Native counterparts (19.5.0, unreleased): iOS GleapSDK/Gleap-iOS-SDK#65, Android GleapSDK/Android-SDK#63.

  • iOS: the bridge looks up +[Gleap initializeWithProjectId:] at runtime (respondsToSelector:) and falls back to initializeWithToken:. It works with the released 19.4.0 and with 19.5.0, and there's no deprecation warning once the pin moves.
  • Android: no API change. Gleap.initialize(projectId, application) is used as before.
  • JWT provider bridge (+[Gleap setUserJwtProvider:] / Gleap.getInstance().setUserJwtProvider(GleapUserJwtProvider)): works whether it's set before or after initialize. It answers nil/null on failure or when no app provider is set, null removes it, and the native gate enforces the 10 s timeout. With 19.5.0 the provider is also asked right after the session answer at app start; the bridge needs nothing extra for that.
  • Native pins stay at 19.4.0 here. Moving them to 19.5.0 needs those native releases first.

The Objective-C helper was syntax-checked with clang -fsyntax-only -Wall -Wextra -Wundeclared-selector against the Gleap 19.4.0 headers: clean.

Native mapping

  • iOS bridge: initialize:(NSString *)projectId → initializeWithProjectId: when the native SDK has it, else initializeWithToken:
  • Android bridge: initialize(String projectId) → Gleap.initialize(projectId, application)

The fallbacks exist in the released native SDKs (19.4.0), which stay pinned.

JWT provider bridge

Checked: works whether it's set before or after initialize, so no logic change. The native SDKs keep the provider in a singleton gate (GleapSessionHelper.userJwtGate on iOS, GleapUserJwtProviderGate on Android) that initialize doesn't reset. The JS userJwtRequested listener is registered at module load. On iOS both calls go through the main queue in order. New tests cover both orders on both platforms. The README now says the provider can be set before or after initialize.

Other

  • README and example say Project ID. Version 19.5.0 (package.json, lockfile header, CHANGELOG). Native pins unchanged at 19.4.0. Not published or tagged.

Tests

  • npx jest src: 2 suites, 38 tests pass (6 new)
  • npx tsc --noEmit -p tsconfig.build.json: passes
  • npx eslint "src/**/*.{js,ts,tsx}": 0 errors (one existing warning)
  • npm pack --dry-run: passes
  • Not run: native compile. The Android library uses Gradle 6.8, which can't run on the only JDK available here (JBR 25). There are no pods or React headers for the iOS module. The native change is a parameter rename only.

🤖 Generated with Claude Code

boehlerlukas and others added 3 commits November 7, 2026 16:03
…ersion 19.5.0

- Typings, JSDoc, native bridge parameter names, README and example call
  the initialize key "Project ID" (the former SDK key, same value). The
  bridge still calls initializeWithToken: / Gleap.initialize(String,
  Application) of the released 19.4.0 native SDKs.
- Tests: the Project ID reaches the native initialize unchanged; a JWT
  provider set before or after initialize answers token requests on iOS
  and Android.
- README: setUserJwtProvider may be called before or after initialize.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Native iOS SDK 19.5.0 (GleapSDK/Gleap-iOS-SDK#65) adds
initializeWithProjectId: and deprecates initializeWithToken:. The bridge
looks the new selector up at runtime and falls back to initializeWithToken:
(the released 19.4.0), so it builds and runs against both without a
deprecation warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… after a restart)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boehlerlukas
boehlerlukas merged commit e850006 into main Nov 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant