Skip to main content
A Node.js app has no dev server, so your app process serves DevTools and you open it in a browser.

Requirements

  • @powersync/node.
  • Node.js 20.16 or later.

Set Up DevTools

1

Install the package

2

Enable DevTools in your app

After you create the database, call enablePowerSyncDiagnostics() in development only.
Import @powersync/diagnostics inside the check. A production install without dev dependencies (npm ci --omit=dev) does not include the package. A static import at the top of the file then stops your app at startup.diagnostics: true is optional. Without it, the Buckets tab does not show the total number of operations for each bucket.
3

Open the sign-in link

Start your app and open the link that it prints. The link contains a one-time code that is valid for five minutes and for one browser. If the code expires, open devtools.url to print a new link in the terminal.
To see what each tab is for, read Using DevTools. To connect a coding agent to the MCP endpoint at <url>/__mcp, read MCP Tools.

Options

Pass options as the second argument: enablePowerSyncDiagnostics(db, { port: 4000 }).
If you set host to an address other than localhost, other devices on your network can reach DevTools, which can read and change your local data. In that case, keep auth set to true.

Return Value

enablePowerSyncDiagnostics() returns an object with these properties: