0.4.0 • Published 7 months ago

next-auth-steam v0.4.0

Weekly downloads
-
License
Unlicense
Repository
github
Last release
7 months ago

next-auth-steam

Steam authentication provider for NextAuth.js.

Install

npm install next-auth-steam

Quickstart

  1. Create a .env file. For configuration details, see: NextAuth Configuration Options.
# .env
NEXTAUTH_URL=
NEXTAUTH_SECRET=

Using App Router

// app/auth/[...nextauth]/route.ts
import NextAuth from 'next-auth'
import Steam from 'next-auth-steam'
import type { NextRequest } from 'next/server'

// Learn more: https://next-auth.js.org/configuration/initialization#route-handlers-app
async function auth(
  req: NextRequest,
  ctx: {
    params: {
      nextauth: string[]
    }
  }
) {
  return NextAuth(req, ctx, {
    providers: [
      Steam(req, {
        clientSecret: process.env.STEAM_SECRET!
      })
    ]
  })
}

export { auth as GET, auth as POST }

Using Pages Router

// pages/api/auth/[...nextauth].ts
import NextAuth from 'next-auth'
import Steam from 'next-auth-steam'
import type { NextApiRequest, NextApiResponse } from 'next'

// Learn more: https://next-auth.js.org/configuration/initialization#advanced-initialization
export default async function auth(req: NextApiRequest, res: NextApiResponse) {
  return await NextAuth(req, res, {
    providers: [
      Steam(req, {
        clientSecret: process.env.STEAM_SECRET!
      })
    ]
  })
}

Examples

!NOTE Pages Router example uses Next.js 13. App Router example uses the latest version (Next.js 15).

All examples are located in the examples folder. Feel free to open a PR if you'd like to add another example!

0.4.0

7 months ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago