authkit-nextjs
The WorkOS library for Next.js provides convenient helpers for authentication and session management using WorkOS & AuthKit with Next.js.
File Explorer
- bug_report.md
- ci.yml
- lint-pr-title.yml
- release-please.yml
- release.yml
- CODEOWNERS
- page.tsx
- signOut.ts
- route.ts
- route.ts
- footer.tsx
- sign-in-button.tsx
- route.ts
- favicon.ico
- layout.tsx
- page.tsx
- env.d.ts
- proxy.ts
- .env.local.example
- next.config.js
- package.json
- README.md
- tsconfig.json
- page.tsx
- signOut.ts
- route.ts
- footer.tsx
- sign-in-button.tsx
- route.ts
- layout.tsx
- page.tsx
- env.d.ts
- proxy.ts
- .dev.vars.example
- .env.local.example
- package.json
- README.md
- tsconfig.json
- tsconfig.tsbuildinfo
- vite.config.ts
- wrangler.jsonc
- authkit-provider.spec.tsx
- authkit-provider.tsx
- button.spec.tsx
- button.tsx
- impersonation.spec.tsx
- impersonation.tsx
- index.ts
- min-max-button.spec.tsx
- min-max-button.tsx
- tokenStore.spec.ts
- tokenStore.ts
- useAccessToken.spec.tsx
- useAccessToken.ts
- useRecentAuth.spec.tsx
- useRecentAuth.ts
- useTokenClaims.spec.tsx
- useTokenClaims.ts
- actions.spec.ts
- actions.ts
- auth.spec.ts
- auth.ts
- authkit-callback-route.spec.ts
- authkit-callback-route.ts
- cookie.spec.ts
- cookie.ts
- env-variables.ts
- errors.spec.ts
- errors.ts
- feature-flags.spec.ts
- feature-flags.ts
- get-authorization-url.spec.ts
- get-authorization-url.ts
- index.ts
- interfaces.ts
- jwt.spec.ts
- jwt.ts
- middleware-helpers.spec.ts
- middleware-helpers.ts
- middleware.spec.ts
- middleware.ts
- pkce.spec.ts
- pkce.ts
- session.spec.ts
- session.ts
- test-helpers.ts
- use-server-guard.spec.ts
- utils.spec.ts
- utils.ts
- validate-api-key.spec.ts
- validate-api-key.ts
- workos.spec.ts
- workos.ts
- react.d.ts
- .eslintignore
- .eslintrc.cjs
- .gitignore
- .oxfmtrc.json
- .oxlintrc.json
- .release-please-manifest.json
- CHANGELOG.md
- context7.json
- LICENSE
- package.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
- README.md
- release-please-config.json
- renovate.json
- tsconfig.app.json
- tsconfig.base.json
- tsconfig.json
- tsconfig.test.json
- vitest.config.ts
- vitest.server-only-stub.ts
- vitest.setup.ts
# Use via CDN
jsDelivrjsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.
Command Glossary
Commands referenced in this DOCs, explained below.
openssl rand
View Details ▼
openssl rand
Generate random bytes using a cryptographically secure PRNG.
openssl rand -hex 8
Generate an 8-byte (16 characters) hex string and write it to `stdout`:
openssl rand -base64 20
Generate 20 random bytes encoded in base64:
openssl rand -out {{path/to/file}} {{length}}
Generate random bytes and write them to a file (without encoding):
openssl
View Details ▼
openssl
OpenSSL cryptographic toolkit.
Some subcommands such as `req` have their own usage documentation.
openssl genpkey -algorithm {{rsa|ec}} -out {{path/to/private.key}} -aes256
Generate a private key and encrypt the output file using AES-256:
openssl rsa -in {{path/to/private.key}} -pubout -out {{path/to/public.key}}
Generate the corresponding public key from the private key `private.key` using `rsa`:
openssl req -new -x509 -key {{path/to/private.key}} -out {{path/to/certificate.crt}} -days 365
Generate a self-signed certificate valid for a specified number of days (365):
pnpm
View Details ▼
pnpm
Fast, disk space efficient package manager for Node.js.
Manage Node.js projects and their module dependencies.
pnpm init
Create a `package.json` file:
pnpm {{[i|install]}}
Download all the packages listed as dependencies in `package.json`:
pnpm add {{module_name}}@{{version}}
Download a specific version of a package and add it to the list of dependencies in `package.json`:
yarn
View Details ▼
yarn
JavaScript and Node.js package manager alternative.
yarn global add {{module_name}}
Install a module globally:
yarn install
Install all dependencies referenced in the `package.json` file (the `install` is optional):
yarn add {{module_name}}@{{version}}
Install a module and save it as a dependency to the `package.json` file (add `--dev` to save as a dev dependency):
