Now that you have LaunchKit AWS running locally, let’s bring its core features to life by connecting it to third-party services. All configuration is managed in the .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

  1. Go to the Google Cloud Console.
  2. Create a new project or select an existing one.
  3. Create an OAuth 2.0 Client ID.
  4. Set the application type to Web application.
  5. Add an “Authorized redirect URI”: http://localhost:4002/api/auth/callback/google
  6. Copy the Client ID and Client Secret.
  7. Add them to your .env file:
# .env
GOOGLE_CLIENT_ID="YOUR_GOOGLE_CLIENT_ID"
GOOGLE_CLIENT_SECRET="YOUR_GOOGLE_CLIENT_SECRET"

GitHub Login

  1. Go to your GitHub Developer Settings.
  2. Click New OAuth App.
  3. Set the “Authorization callback URL” to http://localhost:4002/api/auth/callback/github.
  4. Copy the Client ID and generate a New Client Secret.
  5. Add them to your .env file:
# .env
GITHUB_CLIENT_ID="YOUR_GITHUB_CLIENT_ID"
GITHUB_CLIENT_SECRET="YOUR_GITHUB_CLIENT_SECRET"

Configuring Payments (Stripe)

To process payments and manage subscriptions, you’ll need to connect your Stripe account.
  1. Go to your Stripe Dashboard.
  2. Copy your Publishable key and Secret key.
  3. 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.
  4. Add these keys to your .env file:
# .env
STRIPE_SECRET_KEY="sk_test_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."

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.
  1. Go to your Resend Dashboard.
  2. Create a new API Key.
  3. Add the key to your .env file:
# .env
RESEND_API_KEY="re_..."

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.