@pbvision/partner-sdk 0.1.7 → 0.1.9
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 +11 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ standard length game, so we'll notify your servers when the results are ready.
|
|
|
13
13
|
- [Option 1: PBV downloads your video from a URL](#option-1-pbv-downloads-your-video-from-a-url)
|
|
14
14
|
- [Option 2: Upload your video](#option-2-upload-your-video)
|
|
15
15
|
- [After Video Processing is Done](#after-video-processing-is-done)
|
|
16
|
+
- [Callback Data](#callback-data)
|
|
16
17
|
- [Video Guidelines](#video-guidelines)
|
|
17
18
|
- [Reference Guide](#reference-guide)
|
|
18
19
|
|
|
@@ -21,7 +22,9 @@ standard length game, so we'll notify your servers when the results are ready.
|
|
|
21
22
|
### Step 1: Get API Access
|
|
22
23
|
|
|
23
24
|
Email **[dev@pb.vision](mailto:dev@pb.vision)** to request API access for your
|
|
24
|
-
account.
|
|
25
|
+
account. Let us know which data you need access to (e.g. insights, stats) which
|
|
26
|
+
is documented below in the [Callback Data](#callback-data) section. We'll send
|
|
27
|
+
you an API Key after discussing your needs more in depth.
|
|
25
28
|
|
|
26
29
|
### Step 2: SDK Setup
|
|
27
30
|
|
|
@@ -60,7 +63,7 @@ curl -X POST \
|
|
|
60
63
|
-H 'x-api-key: YOUR_API_KEY' \
|
|
61
64
|
-H 'Content-Type: application/json' \
|
|
62
65
|
-d '{"url": "https://YOUR_WEBHOOK_URL"}' \
|
|
63
|
-
https://api-
|
|
66
|
+
https://api-2o2klzx4pa-uc.a.run.app/partner/webhook/set
|
|
64
67
|
```
|
|
65
68
|
|
|
66
69
|
### Send Videos
|
|
@@ -93,11 +96,9 @@ curl -X POST \
|
|
|
93
96
|
-H 'x-api-key: YOUR_API_KEY' \
|
|
94
97
|
-H 'Content-Type: application/json' \
|
|
95
98
|
-d '{"url": "https://YOUR_VIDEO_URL", "userEmails": ["test@example.com"]}' \
|
|
96
|
-
https://api-
|
|
99
|
+
https://api-2o2klzx4pa-uc.a.run.app/partner/add_video_by_url
|
|
97
100
|
```
|
|
98
101
|
|
|
99
|
-
To use the production server instead of the test server, change `ko3kowqi6a` to `2o2klzx4pa`.
|
|
100
|
-
|
|
101
102
|
#### Option 2: Upload your video
|
|
102
103
|
|
|
103
104
|
You can directly upload your video from a file using the SDK too:
|
|
@@ -134,6 +135,7 @@ data is enabled for your API key, only some of these fields may be present):
|
|
|
134
135
|
"from_url": "https://example.com/my-video.mp4",
|
|
135
136
|
"webpage": "https://pb.vision/video/tvgz3pqij0ll",
|
|
136
137
|
"cutVideo": "https://storage.googleapis.com/pbv-pro/xyz/f50272db-69a8-49ed-9d92-3a4d067af87c/rallies.mp4",
|
|
138
|
+
"cv": CV_DATA,
|
|
137
139
|
"insights": INSIGHTS_DATA,
|
|
138
140
|
"stats": STATS_DATA,
|
|
139
141
|
"vid": STRING,
|
|
@@ -144,11 +146,14 @@ data is enabled for your API key, only some of these fields may be present):
|
|
|
144
146
|
}
|
|
145
147
|
```
|
|
146
148
|
|
|
149
|
+
### Callback Data
|
|
150
|
+
|
|
147
151
|
- `from_url` is the video url you sent us in [step 3](#send-videos)
|
|
148
152
|
- `webpage` is a link to our web app where the stats can be explored
|
|
149
153
|
- `error` is only present if your video could not be processed
|
|
154
|
+
- `cv` contains low-level frame-by-frame data
|
|
150
155
|
- `insights` describes the pickleball game in a detailed, shot-by-shot format
|
|
151
|
-
- Explore the _insights_ schema at <https://pbv-public.github.io/insights
|
|
156
|
+
- Explore the _insights_ schema at <https://pbv-public.github.io/insights>
|
|
152
157
|
- Schema changes and diffs are in our [`pbv-public/insights` repo](https://github.com/pbv-public/insights/blob/dev/CHANGELOG.md)
|
|
153
158
|
- `stats` various stats about the game for advanced players
|
|
154
159
|
- Explore the _stats_ schema at <https://pbv-public.github.io/stats?s=~stats~game>
|