@testerpaykit/react 0.0.0-stage → 1.0.0
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 +49 -2
- package/dist/index.d.mts +876 -0
- package/dist/index.d.ts +876 -0
- package/dist/index.js +7909 -0
- package/dist/index.mjs +7829 -0
- package/package.json +55 -3
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @testerpaykit/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The TesterPayKit tester surface for web apps: a floating bug button with a
|
|
4
|
+
menu, a bug report wizard with screenshot and annotation, voice reports,
|
|
5
|
+
one-tap quick actions, retests judged step by step, messages, session
|
|
6
|
+
details and earnings. German or English, following the browser language.
|
|
7
|
+
|
|
8
|
+
Reports, sessions and engaged testing minutes land in your
|
|
9
|
+
[TesterPayKit](https://testerpaykit.com) project.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @testerpaykit/react @testerpaykit/sdk @testerpaykit/api-client @testerpaykit/storage-browser
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { useEffect, useState } from 'react';
|
|
21
|
+
import { TesterPayKit } from '@testerpaykit/sdk';
|
|
22
|
+
import { TesterPayKitApiClient } from '@testerpaykit/api-client';
|
|
23
|
+
import { IndexedDBAdapter } from '@testerpaykit/storage-browser';
|
|
24
|
+
import { TpkTesterHub } from '@testerpaykit/react';
|
|
25
|
+
|
|
26
|
+
export function Tpk({ screen }: { screen: string }) {
|
|
27
|
+
const [sdk, setSdk] = useState<TesterPayKit | null>(null);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const instance = new TesterPayKit({
|
|
30
|
+
apiKey: '',
|
|
31
|
+
projectId: '<your project id>',
|
|
32
|
+
testerId: '<invite code>', // the SDK signs the tester in with it
|
|
33
|
+
deviceId: crypto.randomUUID(),
|
|
34
|
+
storage: new IndexedDBAdapter(),
|
|
35
|
+
apiClient: new TesterPayKitApiClient({ apiKey: '' }),
|
|
36
|
+
deviceMetadata: { os: 'Web', osVersion: navigator.userAgent, deviceModel: 'browser', appVersion: '1.0.0', sdkVersion: '1.0.0', timezoneOffset: -new Date().getTimezoneOffset() },
|
|
37
|
+
appMetadata: { bundleId: 'com.example.web', version: '1.0.0', buildNumber: '1' },
|
|
38
|
+
autoStartSession: true,
|
|
39
|
+
});
|
|
40
|
+
void instance.init().then(() => setSdk(instance));
|
|
41
|
+
}, []);
|
|
42
|
+
return sdk ? <TpkTesterHub sdk={sdk} currentScreen={screen} /> : null;
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`<TpkTesterHub locale="de" />` pins the language.
|
|
47
|
+
|
|
48
|
+
**Web origins:** the API only answers browsers from origins registered in
|
|
49
|
+
your project settings (CORS). Add every domain your app runs on, including
|
|
50
|
+
`http://localhost:<port>` for development.
|