Running in Development Mode
Development mode makes it easier to set up and customize JamComments on your local machine. When your environment is set to anything other than “production”, two helpful things happen:
What Development Mode Does
Section titled “What Development Mode Does”1. Dummy Comments Appear
Section titled “1. Dummy Comments Appear”Instead of fetching real comments from the server, you’ll see a set of example comments. These are just placeholders to help you see how the comment form and existing comments will look on your site. The actual content doesn’t matter — it’s there so you can style and position everything correctly before going live.
2. Comments Are Silently Submitted
Section titled “2. Comments Are Silently Submitted”When you submit a test comment, it will look like it worked — the form will clear, and you’ll see a success message. But nothing actually gets saved, no emails are sent, and no webhooks trigger. This lets you test the comment submission flow without cluttering your real data.
How to Enable Development Mode
Section titled “How to Enable Development Mode”Most JamComments integrations automatically detect your environment, but you can also set it explicitly:
Example: Remix
Section titled “Example: Remix”const markup = await fetchMarkup({ domain: process.env.JAM_COMMENTS_DOMAIN as string, apiKey: process.env.JAM_COMMENTS_API_KEY as string, path: `/posts/${params.slug}`, environment: process.env.NODE_ENV, // "development" or "production"});Example: Bridgetown
Section titled “Example: Bridgetown”Bridgetown.configure do |config| init :bridgetown_jam_comments domain "your.domain.com" api_key "123-api-key" environment "production" # or "development" endendExample: Astro
Section titled “Example: Astro”import { defineConfig } from "astro/config";import { jamComments } from "@jam-comments/astro/config";import "dotenv/config";
export default defineConfig({ integrations: [ jamComments({ domain: process.env.JAM_COMMENTS_DOMAIN, apiKey: process.env.JAM_COMMENTS_API_KEY, environment: "production" // or "development" }), ],});How Environment Detection Works
Section titled “How Environment Detection Works”If you don’t explicitly set an environment, each integration will try to figure it out:
- Jekyll: Falls back to
JEKYLL_ENV - Node-based integrations (Next.js, Remix, etc.): Uses
process.env.NODE_ENV - Bridgetown: Uses
BRIDGETOWN_ENV
When the environment is “production”, real comments are fetched and submissions are actually saved.