Skip to content

Commit 6b5a7d3

Browse files
authored
docs: clarify use cases and document nextjs (#490)
1 parent 871535e commit 6b5a7d3

2 files changed

Lines changed: 30 additions & 18 deletions

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ account pages for Ory a breeze:
1212
- Dynamically adapts the user interface to your Ory identity schema, sign-in and
1313
flow configuration.
1414

15-
Ory Elements comes with several packages:
15+
Ory Elements has several packages:
1616

1717
- [`@ory/elements-react`](./packages/elements-react/README.md)
1818
- [`@ory/nextjs`](./packages/nextjs/README.md)
@@ -22,6 +22,12 @@ Ory Elements comes with several packages:
2222
> before, we recommend migrating to @ory/elements-react. The legacy code base is
2323
> in https://github.com/ory/elements-legacy.
2424
25+
Ory Elements is a set of components that you can use to build your own login,
26+
registration, settings, verification, recovery and consent user interface. To
27+
just integrate authentication into your Next.js application and use the default
28+
user interfaces, follow our
29+
[guide for Auth.js](https://www.ory.sh/docs/getting-started/integrate-auth/auth-js).
30+
2531
## Getting Started
2632

2733
### React

packages/nextjs/README.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
# `@ory/nextjs`
22

3-
This package contains the Next.js SDK for Ory. It is additive to the
4-
`@ory/elements-react` package and provides utility functions for the app and
5-
page router.
3+
This package contains the Next.js SDK for Ory. It provides a set of React
4+
components, server-side components, and hooks to interact with the Ory
5+
ecosystem. Supports both app and page routers.
66

7-
This middleware expects environment variable `NEXT_PUBLIC_ORY_SDK_URL` to be set
8-
to your Ory Network Project SDK URL. This is the URL that you would use to
9-
access the Ory API.
10-
11-
If you have a custom domain for your Ory Network Project, you should use the
12-
custom domain for `NEXT_PUBLIC_ORY_SDK_URL`.
13-
14-
## Installation
15-
16-
Run `npm install @ory/nextjs` or `yarn add @ory/nextjs` to install the package.
7+
> [!NOTE]
8+
> This package's primary use case is for developing custom components for login,
9+
> registration, verification, settings, recovery, or consent. For integrating
10+
> authentication without changing the UI, follow our
11+
> [guide for Auth.js](https://www.ory.sh/docs/getting-started/integrate-auth/auth-js).
1712
18-
### Next.js middleware for local development and preview deployments
13+
## Use case
1914

2015
This package includes a middleware for the app and page router that enables
21-
local development and preview environments to work with Ory's cookie security
22-
model. When using the `@ory/nextjs` middleware, Ory Tunnel is not needed for
23-
development.
16+
local development and preview environments to work with
17+
[Ory's cookie security model](https://www.ory.sh/docs/security-model). When
18+
using the `@ory/nextjs` middleware, Ory Tunnel is not needed for development.
2419

2520
Check the
2621
[app router](https://github.com/ory/elements/blob/main/examples/nextjs-app-router/middleware.ts)
2722
and
2823
[page router](https://github.com/ory/elements/blob/main/examples/nextjs-pages-router/middleware.ts)
2924
middleware example for more details.
3025

26+
## Installation
27+
28+
Run `npm install @ory/nextjs` or `yarn add @ory/nextjs` to install the package.
29+
30+
## Configuration
31+
32+
This middleware expects environment variable `NEXT_PUBLIC_ORY_SDK_URL` to be set
33+
to your Ory Network Project SDK URL. This is the URL that you would use to
34+
access the Ory API. If you have a custom domain for your Ory Network Project,
35+
you should use the custom domain for `NEXT_PUBLIC_ORY_SDK_URL`.
36+
3137
## Learn by example
3238

3339
See the [examples](https://github.com/ory/elements/blob/main/examples) directory

0 commit comments

Comments
 (0)