devtoolsProvider() function
Home > @rimitive/core > devtoolsProvider
devtoolsProvider() function
Section titled “devtoolsProvider() function”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;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
options |
(Optional) |
Returns:
Example 1
Section titled “Example 1”Basic usage
import { createInstrumentation, devtoolsProvider } from '@rimitive/core';
const instrumentation = createInstrumentation({ providers: [devtoolsProvider()],});Example 2
Section titled “Example 2”With debug logging
const instrumentation = createInstrumentation({ providers: [devtoolsProvider({ debug: true })],});
// Events are logged to console:// [Rimitive DevTools] Event: signal:create { id: 'abc-123' }Example 3
Section titled “Example 3”Conditional for development only
const instrumentation = createInstrumentation({ enabled: import.meta.env.DEV, providers: [devtoolsProvider({ debug: import.meta.env.DEV })],});