Skip to content

feat: accept a login box footer in login() - #136

Open
airowe wants to merge 1 commit into
frontegg:masterfrom
airowe:feat/login-box-footer
Open

airowe wants to merge 1 commit into
frontegg:masterfrom
airowe:feat/login-box-footer

Conversation

@airowe

@airowe airowe commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #135 (JS side).

Review the native PRs first. They carry the mechanism, and this one only forwards to them:

This PR does not build until those land, because the bridges assign loginBoxFooter, which they add. As with #128, a native CI failure on loginBoxFooter is expected until then.

What

login() accepts a footer alongside themeOptions and localizations:

await login({
  localizations: { en: { loginBox: { login: { title: 'Sign-in' } } } },
  footer: {
    hideCaptchaBadge: true,
    rows: [
      { variant: 'body', segments: [
        { text: "Don't have an account? " },
        { label: 'Sign up now', url: 'myapp://sign-up' },
      ]},
      { variant: 'fine', segments: [
        { text: 'Protected by reCAPTCHA — ' },
        { label: 'Privacy Policy', url: 'https://policies.google.com/privacy' },
      ]},
    ],
  },
});

It is rendered below the login box's card, on its login screen only. This is the embedded-mode equivalent of boxFooter in @frontegg/react. The rationale is in #135.

Changes

  • src/FronteggNative.ts: LoginBoxCustomization.footer, with LoginBoxFooter, LoginBoxFooterRow and LoginBoxFooterSegment types. The footer is sent through loginWithOptions with the same per-call semantics as the other two: omitted means null, which clears it. A footer also counts toward the "customization needs a newer native SDK" warning on old binaries.
  • iOS bridge: FronteggApp.shared.loginBoxFooter = customization?["footer"]
  • Android bridge: storage.loginBoxFooter = customization?.getMap("footer")?.toHashMap()
  • docs/api.md: a footer row in the options table, plus a "Login box footer" section covering link handling and hideCaptchaBadge.

No new bridge method: loginWithOptions already takes the customization map, so a JS-only update against an older binary still signs in, and only the footer is dropped.

Tests

src/__tests__/index.test.tsx has 15 tests, all passing. There is a new case for forwarding a footer, and the existing expectations now include footer: null. A deliberate mutation that stops forwarding the footer is caught. tsc and eslint are clean on src.

🤖 Generated with Claude Code


Note

Medium Risk
Touches the login customization path and deep-link handling for footer URLs; behavior relies on companion native SDK changes until those ship.

Overview
Adds footer to login() options so embedded login can show structured content below the login card (parity with @frontegg/react’s boxFooter).

TypeScript defines LoginBoxFooter (rows of text/link segments, optional hideCaptchaBadge) and passes footer through existing loginWithOptions with the same per-call rules as theme/localizations: omitted fields become null and clear prior overrides. A non-null footer also triggers the “needs newer native SDK” fallback warning on old binaries.

iOS and Android bridges persist the payload via loginBoxFooter in applyLoginBoxCustomization. Docs document the option, link URL rules, and reCAPTCHA attribution. Tests assert footer forwarding and updated null-clearing expectations.

Depends on upstream native SDKs that implement loginBoxFooter rendering.

Reviewed by Cursor Bugbot for commit bc092d0. Bugbot is set up for automated code reviews on this repo. Configure here.

`login({ footer })` forwards a structured footer to the native SDKs, which
render it below the login box's card on its login screen only: the
embedded-mode equivalent of `boxFooter` in @frontegg/react.

Like `themeOptions` and `localizations`, an omitted footer is sent as null
and clears, so each call fully determines the box's appearance.

This branch has not been deployed

No deployments
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.

Feature request: a login box footer for embedded login (parity with boxFooter)

1 participant