Installing the App
This page describes how to install and set up the Personalized Newsletter app.
Step 1: Clone the Repository
git clone https://github.com/humanity-developers/connect-sdk-examples.git
cd connect-sdk-examples/examples/newsletter-appStep 2: Install Dependencies
bun installStep 3: Configure Environment Variables
cp .env.example .env # ===========================================
# Humanity Protocol OAuth Configuration
# ===========================================
HUMANITY_CLIENT_ID=app_your_client_id_here
HUMANITY_CLIENT_SECRET=sk_your_client_secret_here
HUMANITY_REDIRECT_URI=http://localhost:5173/callback
HUMANITY_BASE_URL=https://api.sandbox.humanity.org/v2
# Public key for JWT verification (get from developer portal)
HUMANITY_PUBLIC_KEY=pk_your_public_key_here
# ===========================================
# MongoDB Configuration
# ===========================================
# For Docker (local):
MONGODB_URI=mongodb://localhost:27017/newsletter-app
MONGODB_DB_NAME=newsletter-app
# ===========================================
# News API (GNews.io)
# Get your free API key at: <https://gnews.io/>
# ===========================================
NEWS_API_KEY=your_gnews_api_key_here
NEWS_API_BASE_URL=https://gnews.io/api/v4
# ===========================================
# App JWT Configuration
# Generate secret with: openssl rand -base64 32
# ===========================================
APP_JWT_SECRET=your_random_secret_here
APP_JWT_ISSUER=newsletter-app
APP_JWT_EXPIRES_IN=86400
# ===========================================
# Humanity App URL (for social connections redirect)
# ===========================================
NEXT_PUBLIC_HUMANITY_APP_URL=https://app.sandbox.humanity.org/
# ===========================================
# Optional: Cron Secret (for production only)
# ===========================================
CRON_SECRET=your_cron_secret_here
Step 4: Generate JWT Secret
Step 5: Start MongoDB (if using Docker)
Step 6: Run the Development Server
Step 7: Test the OAuth Flow
Step 8: Fetch News Articles
Step 9: Refresh and View Your Personalized Feed
Last updated