@extn/segi-js 0.2.16 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/cdn.global.js +25 -25
- package/dist/index.d.mts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +117 -13
- package/dist/index.mjs +106 -2
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -95,6 +95,15 @@ extra data as their second argument; it does not override event fields.
|
|
|
95
95
|
Server captureMessage uses info. Use named imports on Next.js server and an
|
|
96
96
|
injected SegiService on NestJS; setUser/setTag/addBreadcrumb are browser APIs.
|
|
97
97
|
|
|
98
|
+
Browser captureException accepts any value, not only Error instances (v0.2.17+).
|
|
99
|
+
Strings and numbers become the message; objects with a message (and optional
|
|
100
|
+
name/code/stack) keep those fields; event-like wrappers (`{ error }`, `{ reason }`)
|
|
101
|
+
are unwrapped; plain data is serialised. A value with nothing to report — `{}`,
|
|
102
|
+
`undefined`, `null`, an empty array — is dropped unless you pass
|
|
103
|
+
`{ message }` in the context, so a third-party callback handing you an empty
|
|
104
|
+
object no longer produces an "Error: {}" issue. `normalizeError(value)` is
|
|
105
|
+
exported if you want the same conversion in your own code.
|
|
106
|
+
|
|
98
107
|
```ts
|
|
99
108
|
// Browser: include maxBreadcrumbs in your single initialization.
|
|
100
109
|
Segi.init({ projectKey: "segi_pk_live_xxxxx", maxBreadcrumbs: 30 });
|