Skip to content

devtoolsProvider() function

Home > @rimitive/core > devtoolsProvider

Create a DevTools instrumentation provider.

Sends instrumentation events to the Rimitive DevTools browser extension via window.postMessage. In debug mode, also logs to the console.

Signature:

export declare function devtoolsProvider(options?: DevtoolsProviderOptions): InstrumentationProvider;

Parameter

Type

Description

options

DevtoolsProviderOptions

(Optional)

Returns:

InstrumentationProvider

Basic usage

import { createInstrumentation, devtoolsProvider } from '@rimitive/core';
const instrumentation = createInstrumentation({
providers: [devtoolsProvider()],
});

With debug logging

const instrumentation = createInstrumentation({
providers: [devtoolsProvider({ debug: true })],
});
// Events are logged to console:
// [Rimitive DevTools] Event: signal:create { id: 'abc-123' }

Conditional for development only

const instrumentation = createInstrumentation({
enabled: import.meta.env.DEV,
providers: [devtoolsProvider({ debug: import.meta.env.DEV })],
});