Skip to content

feat: bridge entitlements and admin portal from native SDKs (2.1.0)#78

Merged
dianaKhortiuk-frontegg merged 2 commits into
masterfrom
feat/entitlements-and-admin-portal
Jun 25, 2026
Merged

feat: bridge entitlements and admin portal from native SDKs (2.1.0)#78
dianaKhortiuk-frontegg merged 2 commits into
masterfrom
feat/entitlements-and-admin-portal

Conversation

@dianaKhortiuk-frontegg

Copy link
Copy Markdown
Collaborator

Summary

  • Bumps FronteggSwift 1.2.76 → 1.3.6 and com.frontegg.sdk:android 1.3.18 → 1.3.31, which is where the entitlements API and the embedded admin portal landed on the native side.
  • Adds a thin Capacitor bridge so JS callers can use both features without touching native code.
  • Version → 2.1.0.

New JS surface on FronteggService

loadEntitlements(forceRefresh = false): Promise<{ success: boolean }>
getFeatureEntitlement(key: string): Promise<Entitlement>
getPermissionEntitlement(key: string): Promise<Entitlement>
showAdminPortal(): Promise<void>            // Beta

Entitlement is { isEntitled: boolean; justification?: string | null } where justification is one of ENTITLEMENTS_DISABLED, ENTITLEMENTS_NOT_LOADED, MISSING_FEATURE, MISSING_PERMISSION, or NOT_AUTHENTICATED (iOS).

Why now

A customer (Electronic Technologies, Vue + Capacitor) needs both features. The native SDKs have them merged on master; the Capacitor pin was just behind. This is the smallest bridge that unblocks them.

Native entry points used

  • iOSFronteggAuth.loadEntitlements(forceRefresh:completion:), getFeatureEntitlements(featureKey:), getPermissionEntitlements(permissionKey:), AdminPortalView() presented in a UIHostingController sheet over bridge.viewController.
  • AndroidFronteggAuth.loadEntitlements(forceRefresh, completion), getFeatureEntitlements(key, null), getPermissionEntitlements(key, null), AdminPortalActivity.open(activity). The <activity> is declared in the Android SDK manifest, so host apps need no manifest change.

Test plan

  • CI: npm run verify (web + iOS pod install/xcodebuild + Android gradle build) passes against the new native pins.
  • Example app: call loadEntitlements() after login and after switchTenant(), then getFeatureEntitlement('beta-dashboard') on a tenant that holds the feature and one that does not — confirm justification values.
  • Example app: tap "Open Admin Portal" on iOS — sheet presents, dismisses via swipe and via the portal's X button. Then on Android — AdminPortalActivity launches and back/X both close.
  • E2E (follow-up): extend the Android/iOS suites added in E2E: P0 login/logout (Android Espresso + iOS XCUITest) #77 with a happy-path admin-portal open/close test.

Notes

  • Admin portal is flagged Beta in docs to match the upstream warning on AdminPortalActivity and AdminPortalView.
  • Local npm run build + npm run lint are green. Native verifies require a Capacitor host app (cap sync wires :capacitor-android and runs pod install), so CI is the source of truth for those.

🤖 Generated with Claude Code

dianaKhortiuk-frontegg and others added 2 commits May 21, 2026 22:08
Bumps FronteggSwift 1.2.76 -> 1.3.6 and com.frontegg.sdk:android 1.3.18 ->
1.3.31, which is where the entitlements API and the embedded admin portal
landed on the native side. Adds a thin Capacitor bridge so JS callers can use
both features without touching native code.

New JS surface on FronteggService:
- loadEntitlements(forceRefresh?) — call after login and after switchTenant
- getFeatureEntitlement(key) -> { isEntitled, justification }
- getPermissionEntitlement(key) -> { isEntitled, justification }
- showAdminPortal() — Beta; presents AdminPortalView on iOS, starts
  AdminPortalActivity on Android (declared by the SDK manifest)

Docs (usage.md) gain "Entitlements" and "Admin portal (Beta)" sections,
including the justification enum table. Version bumped to 2.1.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolved conflicts:
- Admin portal: adopt master's openAdminPortal(); drop the branch's
  duplicate showAdminPortal() across TS, iOS (.swift/.m), Android (.java), docs.
- Keep the branch's new entitlements API (loadEntitlements /
  getFeatureEntitlement / getPermissionEntitlement + Entitlement type).
- Native SDK pins: take master's newer FronteggSwift 1.3.10 and
  com.frontegg.sdk:android 1.3.34.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dianaKhortiuk-frontegg
dianaKhortiuk-frontegg merged commit 8c5b301 into master Jun 25, 2026
1 check passed
dianaKhortiuk-frontegg added a commit that referenced this pull request Jun 25, 2026
* docs: add Entitlements & Admin Portal to README; dedupe Native SDK versions

Surface the two capabilities wired in #78 (entitlements + admin portal)
on the README landing page, linking to the usage/advanced guides, and
remove the duplicated 'Native SDK versions' section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs: fix 'scenarIonic' typo in README

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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