Requirements

Pusher

Set up Pusher Channels for real-time updates in the dashboard.

This document describes how to set up Pusher Channels for real-time functionality in the application.

Overview

The application uses Pusher Channels to provide real-time updates and WebSocket communication. Pusher handles the complexity of maintaining persistent connections and broadcasting messages to connected clients.

Environment Configuration

Once you have followed the steps below, you will add the following credentials to your .env file:

PUSHER_APP_ID=1234567
PUSHER_KEY=xxxxxxxxxxxxxxxxxxxx
PUSHER_SECRET=xxxxxxxxxxxxxxxxxxxx
PUSHER_CLUSTER=us2

Prerequisites

  • A valid email address
  • Basic understanding of your application's real-time requirements

Step 1: Sign Up for Pusher

  1. Navigate to pusher.com
  2. Click Sign up in the top right corner
  3. Choose to sign up with:
    • GitHub account (recommended for developers)
    • Google account
    • Email address
  4. Complete the registration process
  5. Verify your email address if signing up with email

Step 2: Create a Channels App

After logging in, you'll be prompted to create your first app.

  1. Click Create app or navigate to the dashboard and click Create app

  2. Fill out the app creation form:

    Name your app:

    • Enter a descriptive name (e.g., "Production App" or "My Website")

    Select a cluster:

    • Choose the cluster closest to your users and infrastructure
    • Common options:
      • us2 - US East (Ohio)
      • us3 - US West (Oregon)
      • eu - EU (Ireland)
      • ap1 - Asia Pacific (Singapore)
    • Note: The cluster cannot be changed after creation

    Select your tech stack (optional):

    • Choose Frontend: Vanilla JS, React, Vue, etc.
    • Choose Backend: Python/Django, Node.js, etc.
    • This just provides quickstart code examples
  3. Click Create app

Step 3: Get Your App Credentials

After creating your app, you'll see the App Keys section:

  1. Copy the following credentials:

    • app_id - Your Pusher application ID
    • key - Your public key (safe to use in frontend code)
    • secret - Your secret key (keep this secure, backend only)
    • cluster - Your selected cluster (e.g., us2)
  2. These values are always available in the dashboard:

    • Navigate to App Settings for your app
    • Click App Keys tab

Step 4: Configure Environment Variables

Add the following credentials to your .env file:

# Pusher Configuration
PUSHER_APP_ID=1234567
PUSHER_KEY=a1b2c3d4e5f6g7h8i9j0
PUSHER_SECRET=a1b2c3d4e5f6g7h8i9j0
PUSHER_CLUSTER=us2

Replace the values with your actual credentials from the Pusher dashboard.

Security Note: The PUSHER_SECRET should never be exposed in frontend code or committed to version control. Only use it in your backend/server code.

Previous
Google Maps
Next
Auth0