JSPM

@clerk/nextjs

3.6.1-staging.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 448858
  • Score
    100M100P100Q178732F
  • License MIT

Clerk.dev SDK for NextJS

Package Exports

  • @clerk/nextjs
  • @clerk/nextjs/api
  • @clerk/nextjs/api.js
  • @clerk/nextjs/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@clerk/nextjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Clerk logo

@clerk/nextjs


Overview

Clerk is the easiest way to add authentication and user management to your Next.js application. Add sign up, sign in, and profile management to your application in minutes.

Getting Started

Prerequisites

  • Next.js v10+
  • Node.js v14+

Installation

npm install @clerk/nextjs

Build

To build the package locally with the TypeScript compiler, run:

npm run build

To build the package in watch mode, run the following:

npm run dev

Usage

Clerk requires your application to be wrapped in the <ClerkProvider/> context.

Set NEXT_PUBLIC_CLERK_FRONTEND_API to your Frontend API in your .env.local file to make the environment variable accessible to the Provider.

NEXT_PUBLIC_CLERK_FRONTEND_API=clerk.[your-domain].[tld]

An implementation of <ClerkProvider /> with our flexible Control Components to build an authentication flow in pages/_app.js:

import { ClerkProvider, RedirectToSignIn, SignedIn, SignedOut, UserButton } from '@clerk/nextjs';

function MyApp({ Component, pageProps }) {
  return (
    <ClerkProvider>
      <>
        <SignedIn>
          <>
            <header style={{ padding: 20 }}>
              <UserButton />
            </header>
            <Component {...pageProps} />
          </>
        </SignedIn>
        <SignedOut>
          <RedirectToSignIn />
        </SignedOut>
      </>
    </ClerkProvider>
  );
}

export default MyApp;

For further details and examples, please refer to our Documentation.

Support

You can get in touch with us in any of the following ways:

Contributing

We're open to all community contributions! If you'd like to contribute in any way, please read our contribution guidelines.

Security

@clerk/nextjs follows good practices of security, but 100% security cannot be assured.

@clerk/nextjs is provided "as is" without any warranty. Use at your own risk.

For more information and to report security issues, please refer to our security documentation.

License

This project is licensed under the MIT license.

See LICENSE for more information.