Repository navigation
feat: Gleap.initialize(projectId) naming; version 19.5.0 - #71
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the Project ID naming contract for React Native. The key
Gleap.initializetakes 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, soGleap.initialize('...')calls keep working as they are. Only the typing/JSDoc parameter name changes (formerlytoken).Native SDK PRs
Native counterparts (19.5.0, unreleased): iOS GleapSDK/Gleap-iOS-SDK#65, Android GleapSDK/Android-SDK#63.
+[Gleap initializeWithProjectId:]at runtime (respondsToSelector:) and falls back toinitializeWithToken:. It works with the released 19.4.0 and with 19.5.0, and there's no deprecation warning once the pin moves.Gleap.initialize(projectId, application)is used as before.+[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,nullremoves 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.The Objective-C helper was syntax-checked with
clang -fsyntax-only -Wall -Wextra -Wundeclared-selectoragainst the Gleap 19.4.0 headers: clean.Native mapping
initialize:(NSString *)projectId→initializeWithProjectId:when the native SDK has it, elseinitializeWithToken: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.userJwtGateon iOS,GleapUserJwtProviderGateon Android) thatinitializedoesn't reset. The JSuserJwtRequestedlistener 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 afterinitialize.Other
Tests
npx jest src: 2 suites, 38 tests pass (6 new)npx tsc --noEmit -p tsconfig.build.json: passesnpx eslint "src/**/*.{js,ts,tsx}": 0 errors (one existing warning)npm pack --dry-run: passes🤖 Generated with Claude Code