Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/docs-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Docs links

on:
pull_request:
branches: [main]
branches: [main, v1]
paths:
- "learning/**"
- "scripts/check-docs-links.mjs"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-guards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: E2E guards

on:
pull_request:
branches: [main]
branches: [main, v1]
push:
branches: [main]

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR gate

on:
pull_request:
branches: [main]
branches: [main, v1]

permissions:
contents: read
Expand All @@ -11,7 +11,7 @@ jobs:
gate:
uses: thebridgedev/auth-core/.github/workflows/merge-gate.yml@main
with:
# bun workspace with a root bun.lock: frozen install.
working-directory: .
install-command: bun install --frozen-lockfile --ignore-scripts
# bun, no tracked lockfile: prove every pinned version resolves.
working-directory: bridge-react
install-command: bun install --ignore-scripts
setup-bun: true
31 changes: 6 additions & 25 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Test that the packed package installs cleanly with React 18 and React 19
# Test that the packed package installs and loads with React 18 and React 19
name: Test install

on:
pull_request:
branches: [main]
branches: [main, v1]
push:
branches: [main]

Expand All @@ -26,39 +26,20 @@ jobs:
- name: Build and pack package
run: |
bun install
bun run build
bun run build:bridge
bun run package
mv nebulr-group-bridge-react-*.tgz install-test-pkg.tgz

# TBP-665 — the main entry and `/flags` must share one flag registry in
# the BUILT output (a per-entry build gave each its own copy).
- name: Built dist shares one flag registry
run: cd bridge-react && bun test ./test-dist/shared-registry.dist.tsx

- name: Install with React ${{ matrix.react-version }}
run: |
mkdir -p install-test
cd install-test
npm init -y
npm pkg set type=module
npm install react@^${{ matrix.react-version }} react-dom@^${{ matrix.react-version }}
npm install ../install-test-pkg.tgz
echo "Install with react@${{ matrix.react-version }} succeeded"

- name: Installed package shares one flag registry (ESM + CJS)
- name: The installed package loads
working-directory: install-test
run: |
cat > check.mjs <<'EOF'
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const inst = { flag: () => ({ passed: true, value: true }) };
const mainEsm = await import('@nebulr-group/bridge-react');
const flagsEsm = await import('@nebulr-group/bridge-react/flags');
mainEsm.setBridgeFlagsInstance(inst);
const mainCjs = require('@nebulr-group/bridge-react');
const flagsCjs = require('@nebulr-group/bridge-react/flags');
mainCjs.setBridgeFlagsInstance(inst);
const ok = flagsEsm.getBridgeFlagsInstance() === inst && flagsCjs.getBridgeFlagsInstance() === inst;
console.log(ok ? 'shared registry: ok' : 'shared registry: SPLIT');
process.exit(ok ? 0 : 1);
EOF
node check.mjs
run: node -e "import('@nebulr-group/bridge-react').then((m) => { if (typeof m.BridgeProvider !== 'function') process.exit(1); console.log('loads'); })"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@ project_descriptions/
# Environment files
.env
.env.*
bun.lock

# Playwright output
test-results/
1 change: 0 additions & 1 deletion .lesshst

This file was deleted.

44 changes: 0 additions & 44 deletions .npmignore

This file was deleted.

29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## [1.0.0-alpha.1] - unreleased

Needs `@nebulr-group/bridge-auth-core` 1.0.0-alpha.8. A new major line, for the new Bridge: the React counterpart of `@nebulr-group/bridge-svelte` 1.0.0-alpha.8, with the same pages, settings and wording, so the guides of either package map to the other. `latest` stays on 0.x.

### Changed (breaking)

- **One setting, the issuer.** `<BridgeProvider config={{ issuer }}>` replaces the app id, API base and hosted-page addresses. Every endpoint is read from the issuer's metadata. The issuer must be `https`, except `http://localhost` on your own machine.
- **Every security step lives in `@nebulr-group/bridge-auth-core`**: tokens, PKCE, email links, hand-off, storage and revocation. This package is the React layer over it.
- **Router-agnostic.** `<BridgeProvider router={{ location, navigate }}>` takes your router's location and navigate function (React Router, TanStack Router, Wouter); without one it uses the browser's history. The `./react-router` and `./tanstack-router` entry points are gone.
- **The `./flags` entry point is gone.** Everything is exported from the package root; the default look is `@nebulr-group/bridge-react/styles`.
- **ESM only**, React 18 or 19.

### Added

- **`<BridgeProvider>`**: makes the page's client, sends email links to their pages, guards every navigation with route rules (`public`, `featureFlag` with `any`/`all`, `redirectTo`, `defaultAccess`), and guards again when the session or the flags change. Gates are flags, never roles. A signed-in workspace whose app is not active (`bridge-app-active` off) goes to the plan page.
- **Sign-in pages from one route**: `<Route path="/auth/*" element={<BridgeAuthRoutes />} />` serves sign-in, sign-up, verify-email, forgot-password, set-password, invite, workspaces, handoff, magic-link, passkey-setup and callback. Components: `SignInForm` (password, sign-in link, passkeys, the workspace step), `SignUpForm` (also from an invite), `VerifyEmail`, `ForgotPassword`, `SetPassword`, `InviteLanding`, `WorkspaceChooser`, `MagicLinkLanding`, `PasskeySetupLanding`, `PasskeyManager`, `HostedSignIn` and `HostedCallback` (hosted mode), `HandoffSignIn` (hand-off mode), `SignOutButton`, `ProfileName`.
- **A paused sign-in says how long to wait**: "Too many attempts. Try again in N minutes.", and a locked account says so, in each of the 12 languages.
- **Session storage**: `storage: 'local'` (default) or `'memory'`, where the session never reaches the browser's storage and a sign-up's email link finishes in the tab that started it.
- **Hooks**: `useSession`, `useUser`, `useSignedIn`, `useWorkspace`, `useWorkspaces`, `useMe`, `useFlags`, `useFlag`, `useFlagsStatus`, `useCanManageBilling`, `useCanManageTeam`, `useBilling`, `usePlans`, `useUsage`, `useQuota`, `useLiveStatus`, `useBridge`, `useBridgeRouter`, `useTranslator`. Resources refresh when the person or workspace changes and within a second of a Live notice.
- **Flags**: `<FeatureFlag flagKey>` with `fallback` that learns whether the plan is why a feature is off, and an `upgrade` prompt; `requireFlag()` for code outside components.
- **Billing**: `<BridgeBillingRoutes>` on `/subscription/*`, `PlanPicker`, `BillingPortalButton`, `SubscriptionStatus`, `BillingNotice`, `CheckoutNotice`, `QuotaBanner`, and the upgrade dialog a 402 from your API opens through `bridgeFetch`.
- **The team panel**: `TeamPanel` with members, invites (send, resend, revoke), roles, the workspace and the profile, on Bridge's team endpoints; admin actions follow `bridge-team-manage`.
- **Copy in 12 languages** (`locale`), with your own wording per key (`messages`).
- **`<Link>`**: an in-app link through your router, so a click does not reload the page.

### Not in this alpha

- Server helpers. React has no server side; an API checks the person's token with `@nebulr-group/bridge-auth-core/server`, or the Express and NestJS plugins.

## [0.9.1] - 2026-11-10

### Fixed
Expand Down
Loading
Loading