Skip to content

feat(add): wire Angular, Vue and SvelteKit web apps - #261

Merged
Bccorb merged 1 commit into
mainfrom
feat/add-angular-vue-svelte
Oct 9, 2026
Merged

Bccorb merged 1 commit into
mainfrom
feat/add-angular-vue-svelte

Conversation

@Bccorb

@Bccorb Bccorb commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Closes #248. The last half of it: seamless add now wires Angular, Vue and SvelteKit web apps on the new @seamless-auth/angular (0.2.0), @seamless-auth/vue and @seamless-auth/svelte (0.1.0) bindings, beside React.

What changes

  • Detection:
    • Angular from @angular/core. The entry is app.config.ts, then app.module.ts, then main.ts.
    • Vue from vue, excluding Nuxt. It also finds the file the router is created in.
    • SvelteKit from @sveltejs/kit. Kit 3 imports from #lib, Kit 2 from $lib.
    • Missing router peers (vue-router, @angular/router) are installed with the binding.
    • Nuxt and Svelte without SvelteKit are reported, not wired. The bindings need SvelteKit's navigator, or one written for another router.
  • Env:
    • Vue and SvelteKit get VITE_API_URL in .env.local.
    • Angular's CLI does not read .env, so no file is written and the backend URL goes in the printed provideSeamlessAuth call.
    • The default web origin for CORS is 4200 for Angular.
  • Printed code, one step per file:
    • Angular: providers with the interceptor in app.config.ts, then seamlessAuthRoutes with authGuard and guestGuard in app.routes.ts.
    • Vue: createSeamlessAuthRoutes() and guards in the router file, then app.use(createSeamlessAuth(...)). An app with no vue-router gets a whole router, plus a reminder to render <RouterView />.
    • SvelteKit: src/lib/auth, ssr = false plus the root layout's session and navigator, then the eight screen pages with requireAuth and requireGuest loads.
    • The SvelteKit 3 import is #lib/auth.js: Kit 3 maps #lib/* to src/lib/* as written, so svelte-check cannot resolve it without the extension.
  • The web output moves into src/core/webSnippets.ts. README, seamless help add and a minor changeset are updated. The "does not wire yet" line no longer points at feat(add): add Seamless Auth to existing Go, Rust, Python, Angular, Vue and Svelte projects #248.

Verification

  • Scaffolded apps: I generated a fresh app with each official scaffolder: ng new (Angular 22), create-vue --ts --router, and sv create (SvelteKit 3). Each was paired with an Express backend.
  • Pasting and building: I ran seamless add --local on each and pasted the printed code into the app. Each build passed: ng build, vue-tsc plus vite build, and svelte-check plus vite build.
  • Browser sign-in, on all three:
    1. A visit to / was guarded and redirected to /login.
    2. Registering by email sent the one-time code, which printed in the backend console.
    3. Entering the code worked, and skipping the passkey prompt led to the signed-in page.
    4. /api/me returned 200.
    5. Logout went to /login, and /api/me then returned 401.
  • Vue without vue-router (create-vue --ts with no router): vue-router was installed, and the printed whole-router code type-checks and builds.
  • Tests: npm test passed 1265 tests. Coverage is 98.81 statements, 96.14 branches and 99.23 lines.

seamless add now detects Angular, Vue and SvelteKit beside React,
installs the matching binding (and a router when the app has none),
and prints the code for each file: the provider or plugin, the bundled
sign-in screens as routes, and the signed-in and signed-out guards.
Angular does not read .env, so its printed config carries the backend
URL. Nuxt and Svelte without SvelteKit are reported, not wired.

Closes #248
@Bccorb
Bccorb merged commit 423b750 into main Oct 9, 2026
5 of 6 checks passed
@Bccorb
Bccorb deleted the feat/add-angular-vue-svelte branch October 9, 2026 12:59
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.

feat(add): add Seamless Auth to existing Go, Rust, Python, Angular, Vue and Svelte projects

1 participant