From a6b3364a1108d827818f0d218d9c43ae69ca7753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Thu, 20 Jun 2024 13:23:53 +0200 Subject: [PATCH] docs: update framework READMEs --- README.md | 68 +++++++--------- packages/frameworks-express/README.md | 30 +++---- packages/frameworks-qwik/README.md | 8 +- packages/frameworks-solid-start/README.MD | 98 +++++------------------ packages/frameworks-sveltekit/README.md | 30 +++---- packages/next-auth/README.md | 30 +++---- 6 files changed, 88 insertions(+), 176 deletions(-) diff --git a/README.md b/README.md index 0c596a275d..776c8c3860 100644 --- a/README.md +++ b/README.md @@ -5,21 +5,12 @@

Authentication for the Web.

Open Source. Full Stack. Own Your Data.

- - TypeScript - - - Downloads - - - GitHub Stars - - - GitHub Stable Release - - - Codecov - + GitHub Stable Release + + Downloads + Github Stars + Codecov + TypeScript

Auth.js is a set of open-source packages that are built on standard Web APIs for authentication in modern applications with any framework on any platform in any JS runtime. @@ -43,15 +34,16 @@ - Designed to work with any OAuth service, it supports 2.0+, OIDC - Built-in support for [many popular sign-in services](https://github.com/nextauthjs/next-auth/tree/main/packages/core/src/providers) - Email/Passwordless authentication +- Passkeys/WebAuthn support - Bring Your Database - or none! - stateless authentication with any backend (Active Directory, LDAP, etc.) -- Runtime-agnostic, runs anywhere! (Vercel Edge Functions, Node.js, Serverless, etc.) +- Runtime-agnostic, runs anywhere! (Docker, Node.js, Serverless, etc.) ### Own your data Auth.js can be used with or without a database. - An open-source solution that allows you to keep control of your data -- Built-in support for [MySQL, MariaDB, Postgres, Microsoft SQL Server, MongoDB, SQLite, etc.](https://adapters.authjs.dev) +- Built-in support for [MySQL, MariaDB, Postgres, Microsoft SQL Server, MongoDB, SQLite, GraphQL, etc.](https://adapters.authjs.dev) - Works great with databases from popular hosting providers ### Secure by default @@ -95,97 +87,97 @@ We have an [OpenCollective](https://opencollective.com/nextauth) for companies a - Clerk Logo + Clerk Logo

Clerk
💵 - FusionAuth Logo + FusionAuth Logo
FusionAuth
💵 - Beyond Identity Logo + Beyond Identity Logo
Beyond Identity
💵 - Stytch Logo + Stytch Logo
Stytch
💵 - Prisma Logo + Prisma Logo
Prisma
💵 - Lowdefy Logo + Lowdefy Logo
Lowdefy
💵 - - - Vercel Logo -
-
Vercel
- 💵☁️ - - - - Descope Logo + Descope Logo
Descope
💵 + + - Badass Courses Logo + Badass Courses Logo
Badass Courses
💵 - Encore Logo + Encore Logo
Encore
💵 - Checkly Logo + Checkly Logo
Checkly
☁️ - superblog Logo + superblog Logo
superblog
☁️ - Netlight logo + Netlight logo
Netlight
☁️ + + + Vercel Logo +
+
Vercel
+ ☁️ + diff --git a/packages/frameworks-express/README.md b/packages/frameworks-express/README.md index b6c35f242b..4938fd137d 100644 --- a/packages/frameworks-express/README.md +++ b/packages/frameworks-express/README.md @@ -1,22 +1,16 @@

-
- -

Express Auth

-

Authentication for Express.

-

- - TypeScript - - - npm - - - Downloads - - - GitHub Stars - -

+ + +

Express Auth

+

+

+ Authentication for Express. +

+

+ npm latest release + Downloads + Github Stars + TypeScript

--- diff --git a/packages/frameworks-qwik/README.md b/packages/frameworks-qwik/README.md index 48b6f3aea2..1cdb22c0ee 100644 --- a/packages/frameworks-qwik/README.md +++ b/packages/frameworks-qwik/README.md @@ -1,16 +1,16 @@

-

Qwik Auth.js

+

Qwik Auth

Authentication for Qwik.

- TypeScript - Downloads npm latest release - Github Stars + Downloads + Github Stars + TypeScript

--- diff --git a/packages/frameworks-solid-start/README.MD b/packages/frameworks-solid-start/README.MD index 82d9d93408..63c3e4a3d4 100644 --- a/packages/frameworks-solid-start/README.MD +++ b/packages/frameworks-solid-start/README.MD @@ -1,80 +1,18 @@ -# Getting started - -Recommended to use [create-jd-app](https://github.com/OrJDev/create-jd-app) - -```bash -npm install @auth/solid-start@latest @auth/core@latest -``` - -## Setting It Up - -[Generate auth secret](https://generate-secret.vercel.app/32), then set it as an environment variable: - -``` -AUTH_SECRET=your_auth_secret -``` - -### On Production - -Don't forget to trust the host. - -``` -AUTH_TRUST_HOST=true -``` - -## Creating the api handler - -in this example we are using github so make sure to set the following environment variables: - -``` -GITHUB_ID=your_github_oauth_id -GITHUB_SECRET=your_github_oauth_secret -``` - -```ts -// routes/api/auth/[...solidauth].ts -import { SolidAuth, type SolidAuthConfig } from "@auth/solid-start" -import GitHub from "@auth/core/providers/github" - -export const authOpts: SolidAuthConfig = { - providers: [ - GitHub({ - clientId: process.env.GITHUB_ID, - clientSecret: process.env.GITHUB_SECRET, - }), - ], - debug: false, -} - -export const { GET, POST } = SolidAuth(authOpts) -``` - -## Signing in and out - -```ts -import { signIn, signOut } from "@auth/solid-start/client" -const login = () => signIn("github") -const logout = () => signOut() -``` - -## Getting the current session - -```ts -import { getSession } from "@auth/solid-start" -import { createServerData$ } from "solid-start/server" -import { authOpts } from "~/routes/api/auth/[...solidauth]" - -export const useSession = () => { - return createServerData$( - async (_, { request }) => { - return await getSession(request, authOpts) - }, - { key: () => ["auth_user"] } - ) -} - -// useSession returns a resource: -const session = useSession() -const loading = session.loading -const user = () => session()?.user -``` +

+ + +

SolidStart Auth

+

+

+ Authentication for SolidStart. +

+

+ npm latest release + Downloads + Github Stars + TypeScript +

+ +--- + +Check out the documentation at [solid-start.authjs.dev](https://solid-start.authjs.dev). diff --git a/packages/frameworks-sveltekit/README.md b/packages/frameworks-sveltekit/README.md index cc1dfc532b..23a6352ee2 100644 --- a/packages/frameworks-sveltekit/README.md +++ b/packages/frameworks-sveltekit/README.md @@ -1,22 +1,16 @@

-
- -

SvelteKit Auth

-

Authentication for SvelteKit.

-

- - TypeScript - - - npm - - - Downloads - - - GitHub Stars - -

+ + +

SvelteKit Auth

+

+

+ Authentication for SvelteKit. +

+

+ npm latest release + Downloads + Github Stars + TypeScript

--- diff --git a/packages/next-auth/README.md b/packages/next-auth/README.md index 814e488af4..f3b2fc19c3 100644 --- a/packages/next-auth/README.md +++ b/packages/next-auth/README.md @@ -1,22 +1,16 @@

-
- -

NextAuth.js

-

Authentication for Next.js.

-

- - TypeScript - - - npm - - - Downloads - - - GitHub Stars - -

+ + +

NextAuth.js

+

+

+ Authentication for Next.js. +

+

+ npm beta release + Downloads + Github Stars + TypeScript

---