Unified authentication package for NeuraByte Labs projects.
- JWT verification with Logto JWKS
- Express middleware (auth + guest mode)
- React hooks (useAuth, useGuestMode)
- User sync utilities
- TypeScript support
npm install @mrsarac/authimport { createAuthMiddleware } from '@mrsarac/auth/middleware';
const auth = createAuthMiddleware({
endpoint: 'https://auth.neurabytelabs.com',
audience: 'your-app-id'
});
app.use('/api/protected', auth);import { LogtoProvider } from '@logto/react';
import { AuthProvider, useAuth } from '@mrsarac/auth/react';
function App() {
return (
<LogtoProvider config={logtoConfig}>
<AuthProvider apiResource="https://api.example.com">
<MyApp />
</AuthProvider>
</LogtoProvider>
);
}
function MyComponent() {
const { isAuthenticated, user, login, logout } = useAuth();
// ...
}"We eat our own cooking" - NeuraByte Labs
This package actively uses NeuraByte Labs internal tools:
| Tool | Usage | Status |
|---|---|---|
| Spinoza | Developer experience sentiment tracking | Planned |
| SUBSTANCE | Release date predictions, feature prioritization | Planned |
| @mrsarac/auth | Self-testing (this package authenticates itself) | Active |
- Self-testing active (dogfooding own auth)
- Spinoza DX sentiment tracking
- SUBSTANCE milestone predictions
- Quality: We catch bugs before users do
- Credibility: "We use it ourselves"
- Insight: Internal use = better product
- Speed: Faster feedback loop
Standard: README_DOGFOODING_STANDARD.md
MIT