authey-test
v0.0.1
Published
Expose [Auth.js](https://authjs.dev/) [REST APIs](https://authjs.dev/reference/rest-api) to your express/[connect](https://www.npmjs.com/package/connect) apps.
Downloads
3
Readme
Authey
Expose Auth.js REST APIs to your express/connect apps.
Install
pnpm add @auth/core authey
Usage
Express
import express from 'express'
import { createAuthMiddleware } from 'authey'
import type { AuthOptions } from '@auth/core'
import GithubProvider from '@auth/core/providers/github'
const app = express()
const authOptions: AuthOptions = {}
app.use(createAuthMiddleware(authOptions))
Nuxt
// server/middleware/auth.ts
import { createAuthMiddleware } from 'authey'
export default fromNodeMiddleware(createAuthMiddleware({}))
Fastify
import Fastify from 'fastify'
import Middie from '@fastify/middie'
import { createAuthMiddleware } from 'authey'
async function build() {
const fastify = Fastify()
await fastify.register(Middie)
fastify.use(createAuthMiddleware({}))
return fastify
}
License
MIT License © 2022 Robert Soriano