npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rtk-devtools/core

v0.4.0

Published

Framework-agnostic core engine for RTK Devtools

Downloads

435

Readme


@rtk-devtools/core

Framework-agnostic core engine for RTK Devtools. Handles store observation, snapshot generation, event recording, tag graph building, and the optional Redux middleware for timeline tracking.

This package is part of RTK Devtools.

For React users: You don't need to install this package directly. Install @rtk-devtools/react instead — it includes this package as a dependency and re-exports its full public API.

Install

If you need the core engine without the React adapter (e.g., for a non-React integration):

npm install @rtk-devtools/core
# or
pnpm add @rtk-devtools/core

API

createDevtoolsMiddleware({ api })

Redux middleware that intercepts RTK Query actions to record timeline events. Purely observational — it never modifies actions or state. Without this middleware, the Queries, Mutations, Tags, and Subscriptions panels still work (they read directly from the Redux store). Only the Timeline panel requires it.

import { configureStore } from "@reduxjs/toolkit";
import { createDevtoolsMiddleware } from "@rtk-devtools/core"; // or from "@rtk-devtools/react"
import { api } from "./api";

export const store = configureStore({
  reducer: {
    [api.reducerPath]: api.reducer,
  },
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware()
      .concat(api.middleware)
      .concat(createDevtoolsMiddleware({ api })),
});

The returned middleware also exposes a connectRecorder(recorder) method to integrate with a devtools instance's event recorder.

createRTKDevtools(config)

Create a devtools instance that observes the Redux store and produces snapshots of RTK Query state. Useful for building custom UIs or integrating with other tools.

Config options:

| Option | Type | Default | Description | | ------------------- | ------------- | ---------- | --------------------------------------------- | | api | RTKQueryApi | required | The RTK Query API instance from createApi() | | store | Store | required | The Redux store | | maxTimelineEvents | number | 500 | Maximum timeline events to retain | | throttleMs | number | 100 | Throttle interval for snapshot updates in ms |

Instance methods:

| Method | Description | | -------------------------------------- | -------------------------------------------------------------- | | getSnapshot() | Returns the current DevtoolsSnapshot | | subscribe(listener) | Subscribe to snapshot changes. Returns an unsubscribe function | | start() | Start observing the store | | stop() | Stop observing the store | | clearTimeline() | Clear all recorded timeline events | | getEndpoints() | Get API endpoint definitions (name, type, tag types) | | refetchQuery(endpointName, args) | Dispatch a refetch for a query | | removeCacheEntry(endpointName, args) | Remove a query cache entry |

import { createRTKDevtools } from "@rtk-devtools/core";

const devtools = createRTKDevtools({ api, store });
devtools.start();

devtools.subscribe((snapshot) => {
  console.log(snapshot.stats);
  console.log(snapshot.queries);
  console.log(snapshot.tagGraph);
});

Exported Types

RTKDevtoolsConfig, RTKDevtoolsInstance, DevtoolsSnapshot, DevtoolsStats, DevtoolsQueryEntry, DevtoolsMutationEntry, TagDescription, TagNode, TimelineEvent, TimelineEventType, TimelineEventFilter, ApiEndpointInfo, QueryStatus, EventRecorderInstance, RTKQueryApi, DevtoolsMiddlewareConfig

Peer Dependencies

  • @reduxjs/toolkit >= 1.9.0
  • redux >= 4.2.0 (optional)

Inspiration

This project is inspired by TanStack DevTools.

License

MIT