Skip to main content
Build plugins inject release versions and upload source maps to Proliferate, enabling readable stack traces for minified production code.

Overview

All plugins provide:
  • Release injection: Adds __PROLIFERATE_RELEASE__ global variable to your bundle
  • Source map upload: Automatically uploads .map files after build
  • Auto-detection: Detects release version from git SHA or CI environment variables

Next.js Plugin

Installation

npm install @proliferate/nextjs-plugin

Configuration

// next.config.js
const { withProliferate } = require('@proliferate/nextjs-plugin');

module.exports = withProliferate({
  // Your Next.js config
  reactStrictMode: true,
}, {
  apiKey: process.env.PROLIFERATE_API_KEY,
  endpoint: 'https://api.yourapp.com/api/v1',
});

Options

OptionTypeDefaultDescription
apiKeystringPROLIFERATE_API_KEY envYour Proliferate API key
endpointstringPROLIFERATE_ENDPOINT envAPI endpoint URL
releasestringAuto-detectedRelease version
urlPrefixstring'~/'URL prefix for source map matching
silentbooleanfalseSuppress log output
enableSourceMapsbooleantrueGenerate production source maps
The plugin wraps your Next.js config to:
  1. Enable production source maps by setting productionBrowserSourceMaps: true
  2. Inject release version via Webpack’s DefinePlugin
  3. Set environment variable NEXT_PUBLIC_PROLIFERATE_RELEASE for runtime access

CLI for Source Map Upload

Upload source maps separately using the CLI:
# After running `next build`
npx @proliferate/nextjs-plugin upload \
  --api-key=$PROLIFERATE_API_KEY \
  --endpoint=https://api.yourapp.com/api/v1

CLI Options

OptionDescription
--api-key=KEYAPI key (or PROLIFERATE_API_KEY env var)
--endpoint=URLAPI endpoint (or PROLIFERATE_ENDPOINT env var)
--release=VERSIONRelease version (auto-detected if not specified)
--url-prefix=PREFIXURL prefix (default: ~/_next/)
--out-dir=DIRNext.js output directory (default: .next)
--delete-after-uploadDelete source maps after upload
--dry-runShow what would be uploaded without uploading

CI/CD Example

# GitHub Actions
- name: Build
  run: npm run build

- name: Upload Source Maps
  run: npx @proliferate/nextjs-plugin upload
  env:
    PROLIFERATE_API_KEY: ${{ secrets.PROLIFERATE_API_KEY }}
    PROLIFERATE_ENDPOINT: https://api.yourapp.com/api/v1

Programmatic Upload

import { uploadSourceMaps } from '@proliferate/nextjs-plugin';

await uploadSourceMaps({
  apiKey: process.env.PROLIFERATE_API_KEY,
  endpoint: 'https://api.yourapp.com/api/v1',
  release: process.env.VERCEL_GIT_COMMIT_SHA,
  deleteAfterUpload: true,
});

Webpack Plugin

Installation

npm install @proliferate/webpack-plugin

Configuration

// webpack.config.js
const { ProliferatePlugin } = require('@proliferate/webpack-plugin');

module.exports = {
  devtool: 'hidden-source-map',
  plugins: [
    new ProliferatePlugin({
      apiKey: process.env.PROLIFERATE_API_KEY,
      endpoint: 'https://api.yourapp.com/api/v1',
    }),
  ],
};

Options

OptionTypeDefaultDescription
apiKeystringRequiredYour Proliferate API key
endpointstringRequiredAPI endpoint URL
releasestringAuto-detectedRelease version
urlPrefixstring'~/'URL prefix for source map matching
includestring[]['**/*.js', '**/*.js.map']Patterns to include
excludestring[]['node_modules']Patterns to exclude
deleteAfterUploadbooleanfalseDelete source maps after upload
silentbooleanfalseSuppress log output
dryRunbooleanfalseLog without uploading

Source Map Configuration

Use hidden-source-map to generate source maps without exposing them to browsers.
module.exports = {
  devtool: 'hidden-source-map',
  // ...
};
devtoolSource maps generatedExposed to browser
source-mapYesYes
hidden-source-mapYesNo
nosources-source-mapYes (no source content)Yes

Vite Plugin

Installation

npm install @proliferate/vite-plugin

Configuration

// vite.config.ts
import { defineConfig } from 'vite';
import { proliferate } from '@proliferate/vite-plugin';

export default defineConfig({
  build: {
    sourcemap: 'hidden',
  },
  plugins: [
    proliferate({
      apiKey: process.env.PROLIFERATE_API_KEY,
      endpoint: 'https://api.yourapp.com/api/v1',
    }),
  ],
});

Options

OptionTypeDefaultDescription
apiKeystringRequiredYour Proliferate API key
endpointstringRequiredAPI endpoint URL
releasestringAuto-detectedRelease version
urlPrefixstring'~/'URL prefix for source map matching
excludestring[]['node_modules']Patterns to exclude
deleteAfterUploadbooleanfalseDelete source maps after upload
silentbooleanfalseSuppress log output

Source Map Configuration

export default defineConfig({
  build: {
    sourcemap: 'hidden', // or true
  },
});
sourcemapSource maps generatedExposed to browser
trueYesYes
'hidden'YesNo
'inline'Yes (inline)Yes

Release Auto-Detection

All plugins automatically detect the release version from:
1

Explicit option

release in plugin options
2

Environment variable

PROLIFERATE_RELEASE
3

CI/CD variables

  • GITHUB_SHA (GitHub Actions)
  • VERCEL_GIT_COMMIT_SHA (Vercel)
  • CF_PAGES_COMMIT_SHA (Cloudflare Pages)
  • RENDER_GIT_COMMIT (Render)
  • RAILWAY_GIT_COMMIT_SHA (Railway)
  • GITLAB_CI_COMMIT_SHA (GitLab CI)
  • CIRCLE_SHA1 (CircleCI)
  • COMMIT_SHA, GIT_COMMIT (Generic)
4

Git SHA

git rev-parse HEAD
5

Fallback

build-{timestamp}

Environment Variables

Configure all plugins via environment variables:
# .env or CI/CD secrets
PROLIFERATE_API_KEY=pk_your_api_key
PROLIFERATE_ENDPOINT=https://api.yourapp.com/api/v1
PROLIFERATE_RELEASE=1.2.3  # Optional, auto-detected

Upload Workflow

All plugins follow this workflow:
  1. Create release on Proliferate API
  2. Upload source maps for each .map file found
  3. Finalize release to mark it ready
  4. (Optional) Delete source maps if deleteAfterUpload is true

Troubleshooting

Make sure source maps are being generated:
// Next.js - plugin enables this automatically
module.exports = withProliferate({
  productionBrowserSourceMaps: true,
});

// Webpack
module.exports = { devtool: 'hidden-source-map' };

// Vite
export default defineConfig({ build: { sourcemap: 'hidden' } });
  1. Verify release version matches between SDK and uploaded source maps
  2. Check that URL prefix matches your deployment URLs
  3. Ensure source maps were uploaded for the correct release
Use --dry-run to debug without uploading:
npx @proliferate/nextjs-plugin upload --dry-run
Check:
  • API key is valid
  • Endpoint is reachable
  • Release doesn’t already exist (duplicate uploads fail)
Prevent source maps from being served publicly:
// Webpack
new ProliferatePlugin({
  deleteAfterUpload: true,
});

// CLI
npx @proliferate/nextjs-plugin upload --delete-after-upload