Thank you for contributing to Seamless Auth.
Seamless Auth is:
- Passwordless-first
- Security-focused
- Minimal and intentional
- Infrastructure-grade software
For non-trivial changes:
- Open an issue first
- Explain the motivation
- Describe your proposed solution
- Wait for feedback
The React SDK is developed against a real Seamless Auth server instance.
Contributors must run the local Seamless Auth server while developing changes to this package.
Fork the repository and clone it locally:
# Clone the auth server code or your forks
git clone https://github.com/fells-code/seamless-auth-api.git
# Clone the react SDK
git clone https://github.com/fells-code/seamless-auth-react.gitcd seamless-auth-api
cp .env.example .envIMPORTANT Change the AUTH_MODE env to "web" NOT "server". Change the APP_ORIGIN env to
http://localhost:5173to match vite This lets you authenticate between a web app and the auth server with no need for an API.
docker compose up -dIf you are using docker you can stop here and move on to Step 3.
Start postgres in whatever way your system does e.g. on mac
brew services start postgresqlnpm install
npm run db:create
npm run db:migrate
npm run devEnsure the server is running locally (default: http://localhost:5312).
curl http://localhost:5312/health/status
## Expected result
## {"message":"System up"}You will need a web application to integerate the SDK into. We recommend using Vite for fast iteration:
# If still in the auth directory
cd ../
npm create vite@latest seamless-auth-dev
### Select React as the framework, Typescript as the variantWeb site will be active at http://localhost:5137
From the seamless-auth-react repository:
npm install
npm linkThen inside your test application:
npm link @seamless-auth/react
npm install react-router-domUpdate main.tsx:
// main.tsx
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { AuthProvider, AuthRoutes, useAuth } from '@seamless-auth/react';
import './index.css';
import App from './App.tsx';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
// eslint-disable-next-line react-refresh/only-export-components
function ApplicationRoutes() {
const { isAuthenticated } = useAuth();
return (
<Routes>
{isAuthenticated ? (
<Route path="*" element={<App />} />
) : (
<Route path="*" element={<AuthRoutes />} />
)}
</Routes>
);
}
createRoot(document.getElementById('root')!).render(
<StrictMode>
<BrowserRouter>
<AuthProvider apiHost="http://localhost:5312" mode="web">
<ApplicationRoutes />
</AuthProvider>
</BrowserRouter>
</StrictMode>
);Inside seamless-auth-react:
npm run build -- --watchChanges will automatically rebuild and propagate to your linked development application.
If all went well you should have a directory structure like this
.
├── seamless-auth-api
├── seamless-auth-dev
└── seamless-auth-reactNavigating to http://localhost:5173 give you the seamless auth login page.
If so you are ready to start dev work
When submitting a pull request:
- Ensure the SDK works against a running local auth server
- Verify login, logout, and session behavior
- Confirm role-based logic works as expected
- Run lint and tests before submitting
This ensures changes remain aligned with real authentication flows and infrastructure behavior.
- feat:
- fix:
- docs:
- refactor:
- test:
- chore:
Example:
feat: add configurable token expiration override
- Be scoped
- Include tests
- Update docs
- Pass CI
By contributing, you agree your contributions fall under the project license.