Skip to content

Add templates for SDKs#12

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:migrate
Jun 29, 2026
Merged

Add templates for SDKs#12
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:migrate

Conversation

@brionmario

@brionmario brionmario commented Jun 29, 2026

Copy link
Copy Markdown
Member

Purpose

Adds official boilerplate templates for the ThunderID JavaScript SDKs, giving developers a pre-configured project foundation to bootstrap new applications with ThunderID authentication already wired up.

Approach

Each template is a minimal but production-structured application with the SDK installed, the provider/plugin configured, and sign-in/sign-out flows in place — ready to clone and build on.

Related Issues

Related PRs

  • N/A

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.

Security checks

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

…ration; include React and Vue templates for Vite
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds four complete ThunderID starter templates — Vite+React, Vite+Vue, Nuxt, and Next.js — each containing package manifests, build configs, ThunderIDProvider wiring, and signed-in/signed-out UI pages. Also updates .prettierignore to globally ignore **/.nx and templates.

Changes

Prettier ignore update

Layer / File(s) Summary
Global ignore patterns
.prettierignore
Replaces specific .nx path entries with a global **/.nx pattern and adds templates as an ignored path.

Starter Templates

Layer / File(s) Summary
Vite + React template
templates/react/vite-react-template/package.json, vite.config.js, index.html, src/main.jsx, src/App.jsx, src/Home.jsx, src/index.css, .env.example, README.md
Adds complete Vite React starter: ThunderIDProvider wraps the app in main.jsx, App.jsx defines / and /callback routes, Home.jsx renders signed-in/out UI with user greeting, and env/docs are included.
Vite + Vue template
templates/vue/vite-vue-template/package.json, vite.config.js, index.html, src/main.js, src/App.vue, src/style.css, .env.example, README.md
Adds complete Vite Vue starter: main.js registers ThunderIDPlugin, App.vue wraps content in ThunderIDProvider and conditionally renders signed-in/out UI from Vite env vars.
Nuxt template
templates/nuxt/nuxt-template/package.json, nuxt.config.ts, app.vue, pages/index.vue, .env.example, README.md
Adds complete Nuxt starter: nuxt.config.ts registers @thunderid/nuxt module, app.vue renders <NuxtPage />, and pages/index.vue shows conditional signed-in/out UI.
Next.js template
templates/nextjs/nextjs-template/package.json, tsconfig.json, next.config.ts, app/layout.tsx, app/page.tsx, app/globals.css, .env.example, README.md
Adds complete Next.js App Router starter: layout.tsx wraps children with ThunderIDProvider, page.tsx renders signed-in/out UI as a client component, with full TypeScript config included.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Four new templates, fresh from my burrow,
React, Vue, Nuxt, Next—each path I did furrow.
ThunderID wired, sign-in buttons aglow,
.prettierignore tidied up neat in a row.
Hop in and scaffold, the auth flows are set!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the change but too generic to convey the main scope of adding multiple SDK templates. Use a specific title like 'Add Next.js, Nuxt, React, and Vue SDK templates' to describe the primary change.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description matches the template well with Purpose, Approach, Related Issues, Related PRs, Checklist, and Security sections filled in.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 changed the title Add Next.js and Nuxt.js templates with ThunderID authentication integ… Add templates for SDKs Jun 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🧹 Nitpick comments (2)
templates/vue/vite-vue-template/README.md (1)

15-15: 📐 Maintainability & Code Quality | 🔵 Trivial

Clarify .env file naming for Vite.

The README instructs copying .env.example to .env.local, but Vite automatically loads .env files. If .env.local is the intended file, note that it's gitignored by default in Vite projects; plain .env is also loaded but may be committed. Consider documenting both options or standardizing on .env for simplicity in a starter template.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/vue/vite-vue-template/README.md` at line 15, The README in the Vue
Vite template uses `.env.local` without clarifying how Vite loads environment
files, which can confuse users of the starter template. Update the setup
instructions near the `.env.example` guidance to clearly state whether
`.env.local` is the recommended file or whether `.env` should be used instead,
and mention the expected Vite behavior for each. Keep the wording aligned with
the template’s environment setup flow so users can pick the right filename
immediately.
templates/react/vite-react-template/src/App.jsx (1)

1-2: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use the DOM RouterProvider in this browser template.

React Router’s docs call out react-router/dom as the browser-oriented export because it wires react-dom’s flushSync; importing RouterProvider from react-router skips that integration. (api.reactrouter.com)

Suggested change
-import { createBrowserRouter, RouterProvider } from 'react-router'
+import { createBrowserRouter } from 'react-router'
+import { RouterProvider } from 'react-router/dom'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/react/vite-react-template/src/App.jsx` around lines 1 - 2, The
browser template is importing RouterProvider from the non-DOM entry, which skips
the react-dom integration expected in client apps. Update the App component
import to use the DOM-oriented RouterProvider export while keeping
createBrowserRouter and CallbackRoute unchanged, so the router setup in this
template uses the browser-specific provider entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@templates/nextjs/nextjs-template/next.config.ts`:
- Around line 1-5: The Next.js template source file is missing the required
Apache copyright header, causing `@thunderid/copyright-header` to fail lint. Add
the standard Apache header comment to nextConfig and apply the same header
consistently to the other new Next.js template source files so they pass the
header check.

In `@templates/nextjs/nextjs-template/README.md`:
- Around line 7-19: The setup commands in the Next.js template README use
incorrect scaffold paths and still point to the old sdks/javascript-sdks
location. Update both the create-next-app --example URL and the tiged repository
path in README.md to reference the actual templates/nextjs/nextjs-template
starter so the commands resolve correctly; use the documented setup snippets as
the location to fix.

In `@templates/nextjs/nextjs-template/tsconfig.json`:
- Line 17: The path alias in tsconfig is pointing to a non-existent src
directory, which will break imports using `@/`*. Update the paths mapping in the
Next.js template tsconfig so the `@/`* alias resolves to the actual template root
where app/ lives, or adjust the template structure to place app under src/ and
keep the alias aligned. Use the tsconfig paths entry and the template’s app/
layout as the reference points.

In `@templates/nuxt/nuxt-template/.env.example`:
- Around line 1-2: The .env.example values use the wrong environment variable
names, so the Nuxt starter does not populate runtimeConfig.public.thunderid.
Update the example keys to the public Nuxt runtime env names expected by
`@thunderid/nuxt`, specifically the entries for the client ID and base URL, so
they map into NUXT_PUBLIC_THUNDERID_CLIENT_ID and
NUXT_PUBLIC_THUNDERID_BASE_URL.

In `@templates/nuxt/nuxt-template/package.json`:
- Line 12: The `@thunderid/nuxt` dependency in the Nuxt template package.json is
pointing to an unpublished range, so update that entry to a version that is
actually available on npm. Adjust the package dependency specifier in the
template manifest to a published release of `@thunderid/nuxt` so fresh scaffolds
can install successfully.

In `@templates/nuxt/nuxt-template/README.md`:
- Around line 15-20: The README env table is documenting the wrong keys for the
Nuxt starter, so update the variables listed here to match the module contract
and the values in `.env.example`. Replace the non-prefixed ThunderID entries
with the Nuxt-prefixed env vars used by the Nuxt module, and keep the
descriptions/examples aligned with those names so users configure the starter
correctly.

In `@templates/react/vite-react-template/index.html`:
- Line 5: The favicon reference in the template’s index.html points to an asset
that is not included in this starter, so update the head markup to either remove
the existing favicon link or point it to a real asset that is shipped with the
template. Use the index.html link tag as the locator and ensure the referenced
icon file is present in the template output if you keep the favicon.

In `@templates/react/vite-react-template/README.md`:
- Around line 34-37: The “Learn more” links in the template README point to
stale docs URLs that resolve to missing pages. Update the two Markdown links
under the Learn more section to the publicly available live docs paths under the
/docs/next/... hierarchy, using the existing ThunderID docs and React SDK
reference entries as the targets to replace.
- Around line 7-10: The scaffold command in the README uses an incorrect tiged
source path, which includes an extra sdks/javascript-sdks segment. Update the
example in the React Vite template README to point to the actual template
location under the repository tree, using the README’s scaffold command so users
can copy it successfully. Keep the fix scoped to the command snippet in the
template documentation and ensure the source path matches the template’s real
location.

In `@templates/react/vite-react-template/src/App.jsx`:
- Line 3: The import in App.jsx should be normalized to match the repo’s
import-x/extensions rule by removing the explicit .jsx suffix from the Home
import. Update the App component’s import statement to use the same
extensionless style used elsewhere in the template so lint passes consistently.

In `@templates/react/vite-react-template/src/main.jsx`:
- Line 4: The local import in main.jsx uses an explicit .jsx extension that
conflicts with the current lint rules and will fail CI. Update the App import in
main.jsx to use the extensionless local path form so it matches the template’s
lint configuration and stays consistent with the rest of the project.

In `@templates/react/vite-react-template/vite.config.js`:
- Around line 1-6: The Vite config template is missing the required WSO2 Apache
2.0 copyright header, which causes lint to fail. Add the standard header comment
at the top of the file before the existing imports in vite.config.js, keeping
the current defineConfig/react setup unchanged.

In `@templates/vue/vite-vue-template/src/App.vue`:
- Around line 4-5: The App.vue setup currently reads VITE_THUNDERID_CLIENT_ID
and VITE_THUNDERID_BASE_URL directly into clientId and baseUrl without checking
they exist, which can pass undefined into ThunderIDProvider. Add a validation
step in the same <script setup> block that checks both values before the
provider is used, and throw a clear error message if either is missing so
developers can quickly spot misconfigured .env.local values.

---

Nitpick comments:
In `@templates/react/vite-react-template/src/App.jsx`:
- Around line 1-2: The browser template is importing RouterProvider from the
non-DOM entry, which skips the react-dom integration expected in client apps.
Update the App component import to use the DOM-oriented RouterProvider export
while keeping createBrowserRouter and CallbackRoute unchanged, so the router
setup in this template uses the browser-specific provider entry.

In `@templates/vue/vite-vue-template/README.md`:
- Line 15: The README in the Vue Vite template uses `.env.local` without
clarifying how Vite loads environment files, which can confuse users of the
starter template. Update the setup instructions near the `.env.example` guidance
to clearly state whether `.env.local` is the recommended file or whether `.env`
should be used instead, and mention the expected Vite behavior for each. Keep
the wording aligned with the template’s environment setup flow so users can pick
the right filename immediately.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b9c6a3f8-0dc1-422c-afef-e79c450cea6b

📥 Commits

Reviewing files that changed from the base of the PR and between 8acb297 and ec84e4c.

📒 Files selected for processing (32)
  • .prettierignore
  • templates/nextjs/nextjs-template/.env.example
  • templates/nextjs/nextjs-template/README.md
  • templates/nextjs/nextjs-template/app/globals.css
  • templates/nextjs/nextjs-template/app/layout.tsx
  • templates/nextjs/nextjs-template/app/page.tsx
  • templates/nextjs/nextjs-template/next.config.ts
  • templates/nextjs/nextjs-template/package.json
  • templates/nextjs/nextjs-template/tsconfig.json
  • templates/nuxt/nuxt-template/.env.example
  • templates/nuxt/nuxt-template/README.md
  • templates/nuxt/nuxt-template/app.vue
  • templates/nuxt/nuxt-template/nuxt.config.ts
  • templates/nuxt/nuxt-template/package.json
  • templates/nuxt/nuxt-template/pages/index.vue
  • templates/react/vite-react-template/.env.example
  • templates/react/vite-react-template/README.md
  • templates/react/vite-react-template/index.html
  • templates/react/vite-react-template/package.json
  • templates/react/vite-react-template/src/App.jsx
  • templates/react/vite-react-template/src/Home.jsx
  • templates/react/vite-react-template/src/index.css
  • templates/react/vite-react-template/src/main.jsx
  • templates/react/vite-react-template/vite.config.js
  • templates/vue/vite-vue-template/.env.example
  • templates/vue/vite-vue-template/README.md
  • templates/vue/vite-vue-template/index.html
  • templates/vue/vite-vue-template/package.json
  • templates/vue/vite-vue-template/src/App.vue
  • templates/vue/vite-vue-template/src/main.js
  • templates/vue/vite-vue-template/src/style.css
  • templates/vue/vite-vue-template/vite.config.js

Comment on lines +1 to +5
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {}

export default nextConfig

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add the required Apache header.

@thunderid/copyright-header is already erroring on this file, so the starter will fail lint as-is. The same fix should be applied across the new Next.js template source files.

🧰 Tools
🪛 ESLint

[error] 1-6: Missing WSO2 Apache 2.0 copyright header

(@thunderid/copyright-header)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/nextjs/nextjs-template/next.config.ts` around lines 1 - 5, The
Next.js template source file is missing the required Apache copyright header,
causing `@thunderid/copyright-header` to fail lint. Add the standard Apache header
comment to nextConfig and apply the same header consistently to the other new
Next.js template source files so they pass the header check.

Source: Linters/SAST tools

Comment on lines +7 to +19
```sh
npx create-next-app@latest my-app \
--example https://github.com/thunder-id/thunderid/tree/main/sdks/javascript-sdks/templates/nextjs/nextjs-template
cd my-app
```

Or with tiged:

```sh
npx tiged thunder-id/thunderid/sdks/javascript-sdks/templates/nextjs/nextjs-template my-app
cd my-app
npm install
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Fix the scaffold paths in both setup commands.

The template added in this PR lives under templates/nextjs/nextjs-template, but both examples prepend sdks/javascript-sdks/. As written, the documented create-next-app and tiged commands won't resolve to this starter.

Suggested fix
 npx create-next-app@latest my-app \
-  --example https://github.com/thunder-id/thunderid/tree/main/sdks/javascript-sdks/templates/nextjs/nextjs-template
+  --example https://github.com/thunder-id/thunderid/tree/main/templates/nextjs/nextjs-template
 cd my-app
-npx tiged thunder-id/thunderid/sdks/javascript-sdks/templates/nextjs/nextjs-template my-app
+npx tiged thunder-id/thunderid/templates/nextjs/nextjs-template my-app
 cd my-app
 npm install
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```sh
npx create-next-app@latest my-app \
--example https://github.com/thunder-id/thunderid/tree/main/sdks/javascript-sdks/templates/nextjs/nextjs-template
cd my-app
```
Or with tiged:
```sh
npx tiged thunder-id/thunderid/sdks/javascript-sdks/templates/nextjs/nextjs-template my-app
cd my-app
npm install
```
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/nextjs/nextjs-template/README.md` around lines 7 - 19, The setup
commands in the Next.js template README use incorrect scaffold paths and still
point to the old sdks/javascript-sdks location. Update both the create-next-app
--example URL and the tiged repository path in README.md to reference the actual
templates/nextjs/nextjs-template starter so the commands resolve correctly; use
the documented setup snippets as the location to fix.

"jsx": "preserve",
"incremental": true,
"plugins": [{ "name": "next" }],
"paths": { "@/*": ["./src/*"] }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Point @/* at the actual template root.

This starter places app/ at the repository root, so @/* -> ./src/* will break as soon as someone uses the alias. Either change it to ./* or move the app into src/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/nextjs/nextjs-template/tsconfig.json` at line 17, The path alias in
tsconfig is pointing to a non-existent src directory, which will break imports
using `@/`*. Update the paths mapping in the Next.js template tsconfig so the `@/`*
alias resolves to the actual template root where app/ lives, or adjust the
template structure to place app under src/ and keep the alias aligned. Use the
tsconfig paths entry and the template’s app/ layout as the reference points.

Comment on lines +1 to +2
THUNDERID_CLIENT_ID=your-client-id
THUNDERID_BASE_URL=https://localhost:8090

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use the Nuxt public runtime env names here.

@thunderid/nuxt reads NUXT_PUBLIC_THUNDERID_CLIENT_ID and NUXT_PUBLIC_THUNDERID_BASE_URL from the environment. With the current keys, runtimeConfig.public.thunderid stays unset and the starter boots without the public auth config.

Suggested fix
-THUNDERID_CLIENT_ID=your-client-id
-THUNDERID_BASE_URL=https://localhost:8090
+NUXT_PUBLIC_THUNDERID_CLIENT_ID=your-client-id
+NUXT_PUBLIC_THUNDERID_BASE_URL=https://localhost:8090
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
THUNDERID_CLIENT_ID=your-client-id
THUNDERID_BASE_URL=https://localhost:8090
NUXT_PUBLIC_THUNDERID_CLIENT_ID=your-client-id
NUXT_PUBLIC_THUNDERID_BASE_URL=https://localhost:8090
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 2-2: [UnorderedKey] The THUNDERID_BASE_URL key should go before the THUNDERID_CLIENT_ID key

(UnorderedKey)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/nuxt/nuxt-template/.env.example` around lines 1 - 2, The
.env.example values use the wrong environment variable names, so the Nuxt
starter does not populate runtimeConfig.public.thunderid. Update the example
keys to the public Nuxt runtime env names expected by `@thunderid/nuxt`,
specifically the entries for the client ID and base URL, so they map into
NUXT_PUBLIC_THUNDERID_CLIENT_ID and NUXT_PUBLIC_THUNDERID_BASE_URL.

"preview": "nuxt preview"
},
"dependencies": {
"@thunderid/nuxt": "^0.46.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Repo package version:"
jq -r '.version' packages/nuxt/package.json

echo "Template dependency range:"
jq -r '.dependencies["`@thunderid/nuxt`"]' templates/nuxt/nuxt-template/package.json

echo "Published npm versions:"
npm view `@thunderid/nuxt` versions --json | jq '.[-10:]'

Repository: thunder-id/javascript-sdks

Length of output: 502


Pin @thunderid/nuxt to a published version
^0.46.0 is not on npm yet (published versions stop at 0.2.2), so fresh scaffolds will fail at npm install.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/nuxt/nuxt-template/package.json` at line 12, The `@thunderid/nuxt`
dependency in the Nuxt template package.json is pointing to an unpublished
range, so update that entry to a version that is actually available on npm.
Adjust the package dependency specifier in the template manifest to a published
release of `@thunderid/nuxt` so fresh scaffolds can install successfully.

Comment on lines +34 to +37
## Learn more

- [ThunderID docs](https://thunderid.dev/docs)
- [React SDK reference](https://thunderid.dev/docs/sdks/react)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update the Learn more links to live docs pages.

The two docs targets currently resolve to missing pages, and the ThunderID docs pages surfaced publicly are under the /docs/next/... hierarchy instead. Please swap these to working destinations before shipping the template README. ()

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/react/vite-react-template/README.md` around lines 34 - 37, The
“Learn more” links in the template README point to stale docs URLs that resolve
to missing pages. Update the two Markdown links under the Learn more section to
the publicly available live docs paths under the /docs/next/... hierarchy, using
the existing ThunderID docs and React SDK reference entries as the targets to
replace.

@@ -0,0 +1,12 @@
import { createBrowserRouter, RouterProvider } from 'react-router'
import { CallbackRoute } from '@thunderid/react-router'
import Home from './Home.jsx'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Drop the explicit .jsx suffix here too.

This import currently violates the repo’s import-x/extensions rule, so the template will keep failing lint until it is normalized.

🧰 Tools
🪛 ESLint

[error] 3-3: Unexpected use of file extension "jsx" for "./Home.jsx"

(import-x/extensions)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/react/vite-react-template/src/App.jsx` at line 3, The import in
App.jsx should be normalized to match the repo’s import-x/extensions rule by
removing the explicit .jsx suffix from the Home import. Update the App
component’s import statement to use the same extensionless style used elsewhere
in the template so lint passes consistently.

Source: Linters/SAST tools

import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { ThunderIDProvider } from '@thunderid/react'
import App from './App.jsx'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Drop the explicit .jsx suffix on the local import.

The current lint configuration already rejects this form, so this import will keep the template red in CI until it is changed or the rule is overridden.

🧰 Tools
🪛 ESLint

[error] 4-4: Unexpected use of file extension "jsx" for "./App.jsx"

(import-x/extensions)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/react/vite-react-template/src/main.jsx` at line 4, The local import
in main.jsx uses an explicit .jsx extension that conflicts with the current lint
rules and will fail CI. Update the App import in main.jsx to use the
extensionless local path form so it matches the template’s lint configuration
and stays consistent with the rest of the project.

Source: Linters/SAST tools

Comment on lines +1 to +6
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
plugins: [react()],
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add the required copyright header.

Repo lint is already failing on this file for the missing WSO2 Apache 2.0 header, so this template will not pass CI as-is.

🧰 Tools
🪛 ESLint

[error] 1-7: Missing WSO2 Apache 2.0 copyright header

(@thunderid/copyright-header)


[error] 2-2: Unable to resolve path to module '@vitejs/plugin-react'.

(import-x/no-unresolved)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/react/vite-react-template/vite.config.js` around lines 1 - 6, The
Vite config template is missing the required WSO2 Apache 2.0 copyright header,
which causes lint to fail. Add the standard header comment at the top of the
file before the existing imports in vite.config.js, keeping the current
defineConfig/react setup unchanged.

Source: Linters/SAST tools

Comment on lines +4 to +5
const clientId = import.meta.env.VITE_THUNDERID_CLIENT_ID
const baseUrl = import.meta.env.VITE_THUNDERID_BASE_URL

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard against missing environment variables.

clientId and baseUrl are passed directly from import.meta.env without validation. If these environment variables are missing, ThunderIDProvider receives undefined for required props, which will cause runtime errors. Add validation or a clear error message to help developers who forget to configure .env.local.

🛡️ Proposed validation
<script setup>
import { ThunderIDProvider, SignedIn, SignedOut, SignInButton, SignOutButton, User } from '`@thunderid/vue`'

const clientId = import.meta.env.VITE_THUNDERID_CLIENT_ID
const baseUrl = import.meta.env.VITE_THUNDERID_BASE_URL

if (!clientId || !baseUrl) {
  throw new Error(
    'Missing required ThunderID environment variables. ' +
    'Please copy .env.example to .env.local and fill in your credentials.'
  )
}
</script>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/vue/vite-vue-template/src/App.vue` around lines 4 - 5, The App.vue
setup currently reads VITE_THUNDERID_CLIENT_ID and VITE_THUNDERID_BASE_URL
directly into clientId and baseUrl without checking they exist, which can pass
undefined into ThunderIDProvider. Add a validation step in the same <script
setup> block that checks both values before the provider is used, and throw a
clear error message if either is missing so developers can quickly spot
misconfigured .env.local values.

@brionmario brionmario merged commit 0bdd795 into thunder-id:main Jun 29, 2026
3 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 1, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants