Reference

Configuration

The options PeekInside.attach() takes, and the environment variables it reads.

PeekInside.attach(app, {
  project: 'orders-api',
  maxBodySize: 128 * 1024,
  ignorePaths: ['/health', /^\/metrics/]
});

Options#

Option Default Description
maxBodySize 65536 Bytes captured per request or response body; larger bodies are truncated and marked as such
ignorePaths [] Paths never recorded: string prefixes, regular expressions or (pathname) => boolean
project package.json name Project name in the local dashboard
local on in development Turn the local dashboard on or off
apiKey PEEKINSIDE_API_KEY PeekInside Cloud API key; enables cloud mode
environment PEEKINSIDE_ENV, then NODE_ENV Label shown with each request, such as staging
release PEEKINSIDE_RELEASE, then the platform's commit, then the checked-out commit The deploy that is running (see Releases)
projectRoot the folder of the app's package.json Where the project's name, git commit and source files are read from
captureExceptions true Record exceptions automatically (see Exceptions); report() works either way
sourceContext true Include the source lines around your own code in exception records
sourceMaps true Map stack frames of compiled code back to your source files (see Source maps)
timeline true Record each request's timeline (see Timeline and queries)
captureQueries true Database queries: pg, mysql2, MongoDB, Prisma
captureOutgoing true Outgoing node:http/https calls and fetch
captureLogs true Log lines: the console, pino, winston and NestJS's Logger (see Logs)
logLevel info The lowest level the Logs page records
captureJobs true Runs of node-cron, cron, BullMQ and @nestjs/schedule jobs (see Jobs)
captureMail true Emails sent with nodemailer, for the local dashboard's Mail page (see Mail previews)
loopBlockMs 100 Event-loop blocks this long or longer are recorded on requests; false turns it off (see Runtime)
runtime true Samples of memory, CPU and event-loop delay for the Runtime page; on servers, also how PeekInside Cloud knows the app is up (see App down)
heapProfiling true Heap profiles naming the functions that hold memory, for leaks on the Runtime page; needs runtime, and PeekInside Cloud's Pro plan or above on servers (see Memory leaks)
cpuProfiling true CPU profiles naming the functions behind each event-loop block, on request timelines and the Runtime page; needs runtime and loopBlockMs, and PeekInside Cloud's Pro plan or above on servers (see What blocked the event loop)
queryParams true Keep the (masked) values sent with queries
slowQueryMs 100 Queries this slow or slower are flagged
nPlusOneThreshold 5 A statement run this many times in one request is flagged as an N+1

Common browser and dev-server noise (/favicon.ico, /.well-known/, /__webpack_hmr, /sockjs-node/, /_next/static/, /static/) is never recorded.

Environment variables#

Variable Description
PEEKINSIDE_API_KEY Cloud API key (cloud mode)
PEEKINSIDE_MCP_KEY MCP key, for npx peekinside mcp to read a PeekInside Cloud project (see AI tools)
PEEKINSIDE_ENV Environment label
PEEKINSIDE_RELEASE The deploy that is running, such as a version or commit hash
PEEKINSIDE_PROJECT Project name in the local dashboard
PEEKINSIDE_LOCAL 1 or 0 to force local mode on or off
PEEKINSIDE_HUB_PORT Port of the local dashboard (default 7335)
PEEKINSIDE_HOME Folder for local data (default ~/.peekinside)
PEEKINSIDE_MAX_REQUESTS Requests the local dashboard keeps per project (default 1000)
PEEKINSIDE_MAX_EXCEPTIONS Exceptions the local dashboard keeps per project (default 500)
PEEKINSIDE_URL Base URL of the PeekInside site (default https://www.peekinside.dev), for developing the dashboard itself
PEEKINSIDE_API_URL Base URL of PeekInside Cloud's API, where apps send what they record (default https://api.peekinside.dev; with only PEEKINSIDE_URL set, that site)