Skip to content

feat: add entitlements support to the React Native SDK#82

Merged
dianaKhortiuk-frontegg merged 1 commit into
masterfrom
feature/entitlements
Jun 30, 2026
Merged

feat: add entitlements support to the React Native SDK#82
dianaKhortiuk-frontegg merged 1 commit into
masterfrom
feature/entitlements

Conversation

@dianaKhortiuk-frontegg

Copy link
Copy Markdown
Collaborator

What

Adds entitlements to the React Native SDK — on-device feature/permission gating — matching the native iOS/Android SDKs and the ionic-capacitor plugin (v2.1.1).

New JS API:

  • loadEntitlements(forceRefresh = false): Promise<boolean>
  • getFeatureEntitlement(key: string): Promise<Entitlement>
  • getPermissionEntitlement(key: string): Promise<Entitlement>
  • Entitlement = { isEntitled: boolean; justification?: string | null }

This is wiring, not a native change

The native SDKs this package already bundles ship the full feature, so no native version bump is needed:

  • iOS FronteggSwift 1.3.10loadEntitlements, getFeatureEntitlements, getPermissionEntitlements
  • Android frontegg-android-kotlin 1.3.34 — same

This PR only exposes them through the RN bridge + JS layer.

Changes

  • Android (FronteggRNModule.kt) — three @ReactMethods calling FronteggAuth, serializing Entitlement{ isEntitled, justification }.
  • iOS (FronteggRN.swift + FronteggRN.m) — matching @objc bridge methods.
  • JS (FronteggNative.ts + index.tsx) — the three wrappers + the Entitlement type.
  • Docs (docs/usage.md) — an Entitlements usage section.

Verification

  • tsc --noEmit clean for src/; eslint clean on the changed files.
  • Native compiles in CI (the iOS/Android E2E builds link the SDK into the example app).

Follow-ups (not in this PR)

  • A demo button in the example app + an E2E case (the entitlements tests need a tenant with entitlements configured, so they'd follow the existing "skip without creds" pattern).

🤖 Generated with Claude Code

Wire the native entitlements APIs through the RN bridge and JS API. The feature
already ships in the native SDKs this package bundles (frontegg-ios-swift 1.3.10
and frontegg-android-kotlin 1.3.34), so no native version bump is needed — this
just exposes them to JS.

- Android (FronteggRNModule.kt): loadEntitlements / getFeatureEntitlement /
  getPermissionEntitlement @ReactMethods calling FronteggAuth, serializing
  Entitlement -> { isEntitled, justification }.
- iOS (FronteggRN.swift + .m): matching @objc bridge methods.
- JS (FronteggNative.ts + index.tsx): loadEntitlements(forceRefresh?),
  getFeatureEntitlement(key), getPermissionEntitlement(key), and the Entitlement type.
- docs/usage.md: Entitlements usage section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dianaKhortiuk-frontegg
dianaKhortiuk-frontegg merged commit da60716 into master Jun 30, 2026
5 checks 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.

2 participants