Skip to Content
GuidesConfiguration

Configuration

Plugin options

OptionDescription
ACCESS_TOKENFallback token when SERVER_ACCESS_TOKEN / CLIENT_ACCESS_TOKEN are not set
SERVER_ACCESS_TOKENToken for Node (Next.js server, API routes). Use Rollbar “post_server_item”
CLIENT_ACCESS_TOKENToken for browser. Use Rollbar “post_client_item”
configRollbar config for both runtimes (e.g. environment, captureUncaught)
serverConfigMerged only when running on server
clientConfigMerged only when running in the browser
rollbarInstancePre-initialized Rollbar instance (skips token/config init)
DEBUGLog publish calls to console

If you only need one runtime, pass just ACCESS_TOKEN (or only SERVER_ACCESS_TOKEN or CLIENT_ACCESS_TOKEN). The plugin initializes only when the current runtime has a token.

Rollbar config

Options in config, serverConfig, and clientConfig are passed to the Rollbar SDK. Common keys:

  • environment — e.g. "production", "development".
  • captureUncaught — capture uncaught exceptions (client).
  • captureUnhandledRejections — capture unhandled promise rejections (client).
  • reportLevel — minimum level to send ("debug", "info", "warning", "error", "critical"). Default can filter out info/debug; set to "debug" if you want all levels.
  • payloadcontext, client, server, etc.

See Rollbar’s configuration reference .

Example with reportLevel

To ensure info/debug events (e.g. button clicks) are sent:

RollbarPluginFactory({ CLIENT_ACCESS_TOKEN: process.env.NEXT_PUBLIC_ROLLBAR_CLIENT_TOKEN!, config: { environment: process.env.NODE_ENV, reportLevel: "debug", }, clientConfig: { reportLevel: "debug", }, });
Last updated on