diff --git a/docs/_media/banner.png b/docs/_media/banner.png new file mode 100644 index 000000000..b2074d34e Binary files /dev/null and b/docs/_media/banner.png differ diff --git a/docs/_media/og-image.png b/docs/_media/og-image.png deleted file mode 100644 index 5c541ce85..000000000 Binary files a/docs/_media/og-image.png and /dev/null differ diff --git a/docs/building-your-app.md b/docs/building-your-app.md index ab3cf4950..e25d70ac6 100644 --- a/docs/building-your-app.md +++ b/docs/building-your-app.md @@ -38,16 +38,13 @@ Make sure the services are mounted at route `/api/zenstack/` with a catch all pa ## _optional_ Integrating with NextAuth -If you use NextAuth for authentication, ZenStack also generates an adapter which you can use to configure NextAuth for persistence of user, session, etc. +If you use NextAuth for authentication, you can install the `@zenstackhq/next-auth` package for easier integration. This package provides an adapter and authorization helper that you can use to configure NextAuth. ```ts // pages/api/auth/[...nextauth].ts import service from '@zenstackhq/runtime'; -import { - authorize, - NextAuthAdapter as Adapter, -} from '@zenstackhq/runtime/auth'; +import { authorize, Adapter } from '@zenstackhq/next-auth'; import NextAuth, { type NextAuthOptions } from 'next-auth'; export const authOptions: NextAuthOptions = { @@ -68,6 +65,8 @@ export const authOptions: NextAuthOptions = { export default NextAuth(authOptions); ``` +Find more details [here](integrating-authentication.md) about integrating with different authentication schemes. + ## Using React hooks React hooks are generated for CRUD'ing each data model you defined. They save your time writing explicit HTTP requests to call the generated services. Internally the hooks use [SWR](https://swr.vercel.app/) for data fetching, so you'll also enjoy its built-in features, like caching, revalidation on interval, etc. diff --git a/docs/index.html b/docs/index.html index ede4b4cc5..8c64d821b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -18,7 +18,10 @@ content="width=device-width, initial-scale=1.0, minimum-scale=1.0" /> - + - + - +