Skip to main content

Server SDK Usage

Initialize

const auth = createServerAuth({...});

Routes

app.get('/auth/google', auth.googleLogin);
app.get('/auth/callback', auth.googleCallback);

Validate Session

app.get('/profile', auth.protectedRoute, (req, res) => {
res.json(req.user);
});