diff --git a/.changeset/seamless-service-token-env.md b/.changeset/seamless-service-token-env.md new file mode 100644 index 0000000..2ed29a8 --- /dev/null +++ b/.changeset/seamless-service-token-env.md @@ -0,0 +1,5 @@ +--- +'@seamless-auth/react': patch +--- + +The README's Next.js example reads the service token from `SEAMLESS_SERVICE_TOKEN` instead of `API_SERVICE_TOKEN`. The auth server still reads `API_SERVICE_TOKEN`; both hold the same value. diff --git a/packages/react/README.md b/packages/react/README.md index 27c84be..cd385fc 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -135,7 +135,7 @@ export const { GET, POST, PUT, PATCH, DELETE } = createSeamlessAuthHandler({ authServerUrl: process.env.AUTH_SERVER_URL!, audience: process.env.AUTH_SERVER_URL!, cookieSecret: process.env.COOKIE_SIGNING_KEY!, - serviceSecret: process.env.API_SERVICE_TOKEN!, + serviceSecret: process.env.SEAMLESS_SERVICE_TOKEN!, jwksKid: process.env.JWKS_KID, }); ``` @@ -152,7 +152,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo const session = await getSeamlessSession(await cookies(), { authServerUrl: process.env.AUTH_SERVER_URL!, cookieSecret: process.env.COOKIE_SIGNING_KEY!, - serviceSecret: process.env.API_SERVICE_TOKEN!, + serviceSecret: process.env.SEAMLESS_SERVICE_TOKEN!, jwksKid: process.env.JWKS_KID, userAgent: (await headers()).get('user-agent') ?? undefined, }); @@ -174,6 +174,9 @@ handler above. The full guide, including route protection in `proxy.ts`, is at [docs.seamlessauth.com/build/nextjs](https://docs.seamlessauth.com/build/nextjs/), and `seamless init my-app --nextjs` scaffolds a working starter. +The auth server reads the service token from `API_SERVICE_TOKEN` and the app reads it from +`SEAMLESS_SERVICE_TOKEN`; both hold the same value. + Things to know: - **Use custom UI, not `AuthRoutes`.** The bundled screens route with react-router, which a Next.js