diff --git a/.changeset/neat-beans-wave.md b/.changeset/neat-beans-wave.md deleted file mode 100644 index a34c058..0000000 --- a/.changeset/neat-beans-wave.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -"@statelyai/inspect": minor ---- - -Added new options `sanitizeContext` and `sanitizeEvent` to the inspector configuration. These options allow users to sanitize sensitive data from the context and events before they are sent to the inspector, and also to remove non-serializable data. - -Example usage: - -```typescript -const inspector = createInspector({ - sanitizeContext: (context) => { - // Remove sensitive data from context - const { password, ...safeContext } = context; - return safeContext; - }, - sanitizeEvent: (event) => { - // Remove sensitive data from event - if (event.type === 'SUBMIT_FORM') { - const { creditCardNumber, ...safeEvent } = event; - return safeEvent; - } - return event; - } -}); diff --git a/CHANGELOG.md b/CHANGELOG.md index 8299307..f2f96c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # @statelyai/inspect +## 0.5.0 + +### Minor Changes + +- [#32](https://github.com/statelyai/inspect/pull/32) [`6f7b65a`](https://github.com/statelyai/inspect/commit/6f7b65aff86320575e626e769bb7baf4a20b7669) Thanks [@davidkpiano](https://github.com/davidkpiano)! - Added new options `sanitizeContext` and `sanitizeEvent` to the inspector configuration. These options allow users to sanitize sensitive data from the context and events before they are sent to the inspector, and also to remove non-serializable data. + + Example usage: + + ```typescript + const inspector = createInspector({ + sanitizeContext: (context) => { + // Remove sensitive data from context + const { password, ...safeContext } = context; + return safeContext; + }, + sanitizeEvent: (event) => { + // Remove sensitive data from event + if (event.type === "SUBMIT_FORM") { + const { creditCardNumber, ...safeEvent } = event; + return safeEvent; + } + return event; + }, + }); + ``` + ## 0.3.1 ### Patch Changes diff --git a/package.json b/package.json index b3f34f7..62012c8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "xstate": "^5.14.0" }, "name": "@statelyai/inspect", - "version": "0.4.0", + "version": "0.5.0", "description": "Inspection utilities for state, actors, workflows, and state machines.", "main": "dist/index.js", "repository": "https://github.com/statelyai/inspect.git",