@auther-sdk/node
v1.3.0
Published
Official Node.js middleware for Auther — verify end-user tokens in any Express/Node app.
Maintainers
Readme
@auther-sdk/node
Official Node.js middleware for Auther: verify end-user
tokens in any Express/Node app with a single auther.protect() guard.
Install
npm install @auther-sdk/nodeUsage
import { Auther } from '@auther-sdk/node';
import express from 'express';
import cookieParser from 'cookie-parser';
const app = express();
const auther = new Auther({
clientId: 'req_live_...',
clientSecret: 'sk_live_...',
});
app.use(cookieParser());
// Protect a route. req.autherUser is populated on success.
app.get('/me', auther.protect(), (req, res) => {
res.json({ user: req.autherUser });
});Full guide at auther.ziloris.com/docs.
License
Apache-2.0, Copyright Ziloris.
