https://github.com/clerk/clerk-cypress-nextjs
Example repo using Clerk, Cypress and NextJS
https://github.com/clerk/clerk-cypress-nextjs
Last synced: over 1 year ago
JSON representation
Example repo using Clerk, Cypress and NextJS
- Host: GitHub
- URL: https://github.com/clerk/clerk-cypress-nextjs
- Owner: clerk
- Created: 2022-10-28T19:06:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-13T15:39:44.000Z (over 1 year ago)
- Last Synced: 2024-12-13T17:15:19.595Z (over 1 year ago)
- Language: TypeScript
- Size: 495 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Introduction
Clerk is a developer-first authentication and user management solution. It provides pre-built React components and hooks for sign-in, sign-up, user profile, and organization management. Clerk is designed to be easy to use and customize, and can be dropped into any React or Next.js application.
After following the quickstart you'll have learned how to:
- Install `@clerk/nextjs`
- Set your Clerk API keys
- Add Clerk's middleware
- Add `` and Clerk components
- Run E2E Cypress tests
## Running the template
```bash
npm run cypress:open
```
To run the example locally, you need to:
1. Sign up for a Clerk account at [https://clerk.com](https://dashboard.clerk.com/sign-up?utm_source=DevRel&utm_medium=docs&utm_campaign=templates&utm_content=clerk-nextjs-app-quickstart).
1. Go to the [Clerk dashboard](https://dashboard.clerk.com?utm_source=DevRel&utm_medium=docs&utm_campaign=templates&utm_content=clerk-nextjs-app-quickstart) and create an application.
1. Set the required Clerk environment variables as shown in [the example `env.local.example` file](./.env.local.example).
1. `npm install` the required dependencies.
1. `npm run dev` to launch the development server.
## Testing
1. See the `testing-tokens.cy.ts` file for Cypress E2E tests.
1. Set the `test_user` and `test_password` to the credentials of the test account shown in [the example `.cypress.env.json.example` file](./cypress.env.json.example).
1. `npm run cypress:open` to launch the development server. This will open the Cypress window, which must remain open throughout testing.
1. In Cypress, choose your preferred browser to test. A new browser window should open.
1. From `Specs`, select a test to run it.
If you aren't running your app on `localhost:3000`, update the `baseUrl` in `cypress.config.ts` to match your development server's URL.
## Learn more
To learn more about Clerk and Next.js, check out the following resources:
- [Quickstart: Get started with Next.js and Clerk](https://clerk.com/docs/quickstarts/nextjs?utm_source=DevRel&utm_medium=docs&utm_campaign=templates&utm_content=clerk-cypress-nextjs)
- [Clerk Documentation](https://clerk.com/docs?utm_source=DevRel&utm_medium=docs&utm_campaign=templates&utm_content=clerk-cypress-nextjs)
- [Next.js Documentation](https://nextjs.org/docs)
- [Testing with Cypress](https://clerk.com/docs/testing/cypress?utm_source=DevRel&utm_medium=docs&utm_campaign=templates&utm_content=clerk-cypress-nextjs)
- [Cypress Documentation](https://docs.cypress.io/app/get-started/why-cypress)
## Found an issue or want to leave feedback
Feel free to create a support thread on our [Discord](https://clerk.com/discord). Our support team will be happy to assist you in the `#support` channel.
## Connect with us
You can discuss ideas, ask questions, and meet others from the community in our [Discord](https://discord.com/invite/b5rXHjAg7A).
If you prefer, you can also find support through our [Twitter](https://twitter.com/ClerkDev), or you can [email](mailto:support@clerk.dev) us!