File tree Expand file tree Collapse file tree 2 files changed +60
-2
lines changed Expand file tree Collapse file tree 2 files changed +60
-2
lines changed Original file line number Diff line number Diff line change 1+ # JS SDK for [ Visual Regression Tracker] ( https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker )
2+
3+ ## Install
4+
5+ ` npm install @visual-regression-tracker/sdk-js `
6+
7+ ## Usage
8+ ### Import
9+ ```
10+ import { VisualRegressionTracker, Config } from '@visual-regression-tracker/sdk-js'
11+ ```
12+ ### Configure connection
13+ ```
14+ const config: Config = {
15+ // Fill with your data
16+ apiUrl: "http://localhost:4200",
17+
18+ // Fill with your data
19+ branchName: "develop",
20+
21+ // Fill with your data
22+ projectId: "76f0c443-9811-4f4f-b1c2-7c01c5775d9a",
23+
24+ // Fill with your data
25+ token: "F5Z2H0H2SNMXZVHX0EA4YQM1MGDD",
26+ };
27+
28+ const vrt = new VisualRegressionTracker(config);
29+ ```
30+ ### Send image
31+ ```
32+ await vrt.track({
33+ // Name to be displayed
34+ // Required
35+ name: "Image name",
36+
37+ // Base64 encoded string
38+ // Required
39+ imageBase64: image,
40+
41+ // Allowed mismatch tollerance in %
42+ // Optional
43+ // Default: 1%
44+ diffTollerancePercent: 0,
45+
46+ // Optional
47+ os: "Mac",
48+
49+ // Optional
50+ browser: "Chrome",
51+
52+ // Optional
53+ viewport: "800x600",
54+
55+ // Optional
56+ device: "PC",
57+ });
58+ ```
Original file line number Diff line number Diff line change 11{
22 "name" : " @visual-regression-tracker/sdk-js" ,
3- "version" : " 0.0.6 " ,
3+ "version" : " 0.0.7 " ,
44 "description" : " " ,
55 "main" : " dist/index.js" ,
66 "types" : " dist/index.d.ts" ,
1717 "bugs" : {
1818 "url" : " https://github.com/Visual-Regression-Tracker/vrt-sdk-js/issues"
1919 },
20- "homepage" : " https://github.com/Visual-Regression-Tracker/vrt-sdk-js#readme " ,
20+ "homepage" : " https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker " ,
2121 "dependencies" : {
2222 "axios" : " ^0.19.2"
2323 },
You can’t perform that action at this time.
0 commit comments