Skip to content

Move the samples to the samples repository and add playgrounds - #126

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:move-quickstarts-to-samples
Oct 21, 2026
Merged

brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:move-quickstarts-to-samples

Conversation

@brionmario

@brionmario brionmario commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Purpose

Moves the React, Vue, Next.js, Nuxt, Browser, Express and Node.js quickstarts, and the Better Auth Next.js integration sample, to thunder-id/samples (thunder-id/thunderid#5904). This empties samples/.

Approach

  • Removed samples/*/quickstart. pnpm-workspace.yaml no longer includes them and the lockfile drops their importers. Every override is still reached through packages/*, so none is removed; their justifications no longer cite the sample paths.
  • New tests/e2e/scripts/prepare-samples.ts: copies the quickstarts from thunder-id/samples into tests/e2e/.samples, runs pnpm pack on each built package, and pins every @thunderid/* dependency, direct or transitive, to those tarballs through pnpm overrides. The E2E suite therefore installs this PR's builds the way an adopter would, from packed tarballs. Packaging mistakes, such as a file missing from files, now fail E2E as well. THUNDERID_SAMPLES_REF, THUNDERID_SAMPLES_DIR and THUNDERID_SAMPLES_REPO work as in the other SDK repos. The script runs on plain node (22.18+).
  • run-e2e.sh and the run-e2e-suite action: run the script after pnpm build and drive the apps from tests/e2e/.samples. The .env backup and restore logic is gone because the apps are fresh copies on every run. sample-apps.ts and the node spec use the new paths. ESLint, Prettier and tsconfig ignore the fetched copy.
  • Release: SDK releases no longer attach a sample zip, since thunder-id/samples releases the samples now. That includes @thunderid/better-auth, which attached the integration sample, so the pack-sample action is removed.
  • Better Auth sample: moved to integrations/better-auth-nextjs in Add the Better Auth sample and fix sample releases and the vite advisory samples#11. With samples/ empty, the workspace glob, the ESLint copyright exemption for samples/** and the PR builder's !./samples/** lint and test filters go too.

Verified locally: pnpm install --frozen-lockfile, pnpm build and pnpm format:check pass. tests/e2e passes lint and type-check. The prepare script runs in both local-checkout and clone modes, and the prepared React and Next.js apps build against the local tarballs. The Playwright suite was not run end to end.

Playgrounds

playgrounds/react and playgrounds/express replace the quickstarts for exercising the SDKs from source (thunder-id/thunderid#5919). They are part of the workspace and use workspace:*:

  • playgrounds/react (Vite):
    • Overview: 24 capability checks against the real @thunderid/react API, with run one or run all, a reason for each result, and filters. It also shows a session card with a token countdown, the provider config and an event log.
    • Component explorer: 26 real SDK components with stories, viewport and theme toggles, and Controls, Code, Actions and Accessibility panels.
    • Hooks and Tokens pages.
  • playgrounds/express: an Express server that mounts the real @thunderid/express handlers and example protected routes. It serves an API explorer with "Send as" identities (anonymous, signed in, expired token), the response and headers, the handler source, copy as cURL, and an SDK trace of the middleware and client calls.

The PR builder already covers both: pnpm build type-checks and builds them, and they pass format:check, lint (which excludes only packages and samples) and test. Setup is in each playground's README.

Shown as unavailable or worked around because the SDK has no API for them yet:

  • organizations
  • a public event API (on())
  • manual refresh or expiry on the React context
  • typed user/signIn/signOut
  • a public read of the Express session record
  • a scope or role option on protect()

Screenshots

playgrounds/react: overview

React playground overview with capability checks

playgrounds/react: component explorer

React playground component explorer

playgrounds/express: API explorer

Express playground API explorer

Taken with the local ThunderID server stopped and no client configured, so the overview reports the server as down and the checks have not run.

Related Issues

Related PRs

Merge order: thunder-id/samples#7 (merged) and thunder-id/samples#11 first. The SDK PRs' E2E suites and sample builds fetch the quickstarts from samples main, so they fail at the fetch step until it merges. Re-run their checks afterwards.

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.
  • Cross-SDK parity. Exactly one of parity/prs-raised or parity/prs-not-needed added.
    • If parity/prs-raised, the port links are posted as a reply on the parity check's comment.

Security checks

  • Followed secure coding standards.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🔀 Cross-SDK feature parity, ports raised

This pull request is labelled parity/prs-raised, so the capability it introduces is expected in the other ThunderID SDKs as well.

Ports (DO NOT EDIT)

  • thunder-id/ios-sdks, iOS => #32
  • thunder-id/android-sdks, Android => #39
  • thunder-id/flutter-sdks, Flutter => #50

3 of 3 sibling SDKs accounted for.

Every sibling SDK is accounted for.

The contract is in the SDK development specification.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: thunder-id/javascript-sdks/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: abf07add-45c2-4f71-95b2-d8b76aa64c7e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brionmario
brionmario force-pushed the move-quickstarts-to-samples branch 2 times, most recently from 11139f9 to 1d990db Compare October 20, 2026 04:59
@brionmario brionmario changed the title Move the SDK quickstart samples to the samples repository Move the quickstarts to the samples repository and add playgrounds Oct 20, 2026
The framework quickstarts now live in thunder-id/samples and use the published packages. The E2E suite fetches them through tests/e2e/scripts/prepare-samples.ts and installs them against tarballs of this workspace's builds. SDK releases no longer attach a quickstart archive.

playgrounds/react and playgrounds/express take their place for exercising the SDKs from source: capability checks, a component explorer, hooks and token inspection for React, and an API explorer with an SDK trace for Express.

Refs thunder-id/thunderid#5904

Refs thunder-id/thunderid#5919

Signed-off-by: Brion <info@brionmario.com>
@brionmario
brionmario force-pushed the move-quickstarts-to-samples branch from 1d990db to dc00e4d Compare October 20, 2026 12:58
@brionmario
brionmario merged commit 74c4bff into thunder-id:main Oct 21, 2026
8 checks passed
@brionmario brionmario changed the title Move the quickstarts to the samples repository and add playgrounds Move the samples to the samples repository and add playgrounds Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity/prs-raised Ports exist in the other SDKs, or are recorded as not applying there

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants