Documentation
Authentication

Authentication

For authentication purposes, StudyStudio uses Clerk (opens in a new tab) to implement the backend for managing sign-ups and sign-ins using multiple beautiful minimalists authentication pages. When running it in production, we are using their live environment to host it accordingly.

To sign-in or sign-up, you will need to enter your email address or connect your google/facebook account and follow the given steps.

Create a Clerk Account

Navigate to the Clerk Signin Page (opens in a new tab) and sign up. Now you will be redirected to the Clerk dashboard. This is where you need to click on Create application

StudyStudio
Clerk dashboard while creating a new application.

Creating an Application

Once you are on the process of creating an application, you will be asked to enter the name of the application and select the appropriate sign-in/sign-up methods for your users. For this project, we are using the Email, Google, and Facebook sign-in methods.

StudyStudio
Setting up a new application on clerk.

Setting up the Application

Afterwards, you will be redirected to the application settings page where you can find the Publishable Key and Secret Key. You will need to copy these keys and paste them in the .env.local file in the root directory of the project.

StudyStudio
Finding publishable and secret keys on the dashboard.

Replacing Clerk Publishable Key and Clerk Secret Key

Replace the your-clerk-publishable-key and your-clerk-secret-key with the keys provided in the Clerk dashboard.

.env.local
# CLERK (Authentication service)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY = `Clerk Publishable Key`
CLERK_SECRET_KEY = ``Clerk Secret Key`

Creating a Production Instance

Before you can use the authentication service in production, you need to have a domain you own that is configured with your hosting provider. To create a production instance, you need to click on the Create Production Instance button from the navigation bar of your Clerk dashboard. Fill in the required details and click on the Create Instance button. This will create a production instance for your application.

With this, you have successfully set up the authentication service for StudyStudio. Now you can move on to the next section to set up the payment gateways.

© 2024 StudyStudio Inc. All rights reserved.