.env
file in your project’s root. This file is ignored by Git, ensuring your secret keys are never committed to your repository.
Configuring Authentication (NextAuth)
LaunchKit uses NextAuth.js to handle authentication. While email/password sign-up works out of the box, you can easily enable social logins for providers like Google and GitHub.Google Login
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Create an OAuth 2.0 Client ID.
- Set the application type to Web application.
- Add an “Authorized redirect URI”:
http://localhost:4002/api/auth/callback/google
- Copy the Client ID and Client Secret.
- Add them to your
.env
file:
GitHub Login
- Go to your GitHub Developer Settings.
- Click New OAuth App.
- Set the “Authorization callback URL” to
http://localhost:4002/api/auth/callback/github
. - Copy the Client ID and generate a New Client Secret.
- Add them to your
.env
file:
Configuring Payments (Stripe)
To process payments and manage subscriptions, you’ll need to connect your Stripe account.- Go to your Stripe Dashboard.
- Copy your Publishable key and Secret key.
- For local testing of webhooks, install the Stripe CLI and run
stripe listen --forward-to localhost:4002/api/webhooks/stripe
. This will give you a webhook signing secret. - Add these keys to your
.env
file:
Configuring Transactional Emails
For sending welcome emails, password resets, and other notifications, you’ll need an email provider. LaunchKit is pre-configured for Resend, but can be adapted to others.- Go to your Resend Dashboard.
- Create a new API Key.
- Add the key to your
.env
file:
Next Steps
Your application is now fully configured for local development. The next step is to learn how to deploy it to a live, production environment on AWS.Next: Deployment
Learn how to deploy your fully configured application to AWS using the CDK.