docs/pages/getting-started/providers/reddit.mdx
import { Callout } from "nextra/components" import { Code } from "@/components/Code"
https://example.com/api/auth/callback/reddit
</Code.Next> <Code.Qwik>
https://example.com/auth/callback/reddit
</Code.Qwik> <Code.Svelte>
https://example.com/auth/callback/reddit
</Code.Svelte> </Code>
AUTH_REDDIT_ID
AUTH_REDDIT_SECRET
import NextAuth from "next-auth"
import Reddit from "next-auth/providers/reddit"
export const { handlers, auth, signIn, signOut } = NextAuth({
providers: [Reddit],
})
</Code.Next> <Code.Qwik>
import { QwikAuth$ } from "@auth/qwik"
import Reddit from "@auth/qwik/providers/reddit"
export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(
() => ({
providers: [Reddit],
})
)
</Code.Qwik> <Code.Svelte>
import { SvelteKitAuth } from "@auth/sveltekit"
import Reddit from "@auth/sveltekit/providers/reddit"
export const { handle, signIn, signOut } = SvelteKitAuth({
providers: [Reddit],
})
</Code.Svelte> <Code.Express>
import { ExpressAuth } from "@auth/express"
import Reddit from "@auth/express/providers/reddit"
app.use("/auth/*", ExpressAuth({ providers: [Reddit] }))
</Code.Express> </Code>
export const { handlers, auth, signin, signout } = NextAuth({
providers: [
RedditProvider({
clientId: process.env.REDDIT_CLIENT_ID,
clientSecret: process.env.REDDIT_CLIENT_SECRET,
authorization: {
params: {
duration: "permanent",
},
},
}),
],
})