@mushi-mushi/core 1.33.1 → 1.33.3
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/LICENSE +1 -1
- package/README.md +14 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/reporter-channels.cjs.map +1 -1
- package/dist/reporter-channels.js.map +1 -1
- package/dist/reporter-ui.cjs.map +1 -1
- package/dist/reporter-ui.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -6,6 +6,20 @@ The shared types, API client and utilities under every [Mushi Mushi](https://git
|
|
|
6
6
|
|
|
7
7
|
**You probably don't need to install this directly.** Run `npx mushi-mushi` and the wizard installs the SDK for your framework ([`react`](https://npmjs.com/package/@mushi-mushi/react), [`vue`](https://npmjs.com/package/@mushi-mushi/vue), [`svelte`](https://npmjs.com/package/@mushi-mushi/svelte), [`angular`](https://npmjs.com/package/@mushi-mushi/angular), [`react-native`](https://npmjs.com/package/@mushi-mushi/react-native), [`capacitor`](https://npmjs.com/package/@mushi-mushi/capacitor) or [`web`](https://npmjs.com/package/@mushi-mushi/web)), which depends on this one. Reach for `core` when you build your own adapter or need the types.
|
|
8
8
|
|
|
9
|
+
```bash
|
|
10
|
+
npm install @mushi-mushi/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createPreFilter, captureEnvironment } from '@mushi-mushi/core';
|
|
15
|
+
|
|
16
|
+
const filter = createPreFilter();
|
|
17
|
+
filter.check('asdf'); // { passed: false, reason: 'Too short (min 10 characters)' }
|
|
18
|
+
const env = captureEnvironment(); // viewport, user agent, connection, page timing
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Docs: [Core SDK reference](https://kensaur.us/mushi-mushi/docs/sdks/core)
|
|
22
|
+
|
|
9
23
|
```mermaid
|
|
10
24
|
flowchart LR
|
|
11
25
|
A["Framework SDK<br/>react, vue, web…"] --> B["@mushi-mushi/core<br/>types · API client · queue"] --> C["Mushi API"]
|