@pbvision/partner-sdk 0.1.1 → 0.1.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/README.md CHANGED
@@ -96,6 +96,8 @@ curl -X POST \
96
96
  https://api-ko3kowqi6a-uc.a.run.app/partner/add_video_by_url
97
97
  ```
98
98
 
99
+ To use the production server instead of the test server, change `ko3kowqi6a` to `2o2klzx4pa`.
100
+
99
101
  #### Option 2: Upload your video
100
102
 
101
103
  You can directly upload your video from a file using the SDK too:
@@ -103,7 +105,7 @@ You can directly upload your video from a file using the SDK too:
103
105
  ```javascript
104
106
  import { PBVision } from '@pbvision/partner-sdk'
105
107
 
106
- const pbv = new PBVision(YOUR_API_KEY)
108
+ const pbv = new PBVision(YOUR_API_KEY, { useProdServer: false })
107
109
  // you can omit this metadata, or provide some or all of this object-- whatever you'd like!
108
110
  const optionalMetadata = {
109
111
  userEmails: [],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pbvision/partner-sdk",
3
3
  "description": "SDK for interacting with the PB Vision pickleball AI engine.",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "engines": {
package/src/index.js CHANGED
@@ -12,16 +12,25 @@ const ENVIRONMENTS = {
12
12
  projectId: 'pbv-dev',
13
13
  appId: '1:542837591762:web:06f45c0d7a7e62f25aa70b'
14
14
  }
15
+ },
16
+ prod: {
17
+ apiServer: 'https://api-2o2klzx4pa-uc.a.run.app',
18
+ firebaseConfig: {
19
+ apiKey: 'AIzaSyCzC8mfo38HtkOR-_Y6xb7Pevp72LkrYfc',
20
+ projectId: 'pbv-prod',
21
+ appId: '1:439056169365:web:8b76be9c7cb7a2a13f5e9c'
22
+ }
15
23
  }
16
24
  }
17
25
 
18
26
  /** @public */
19
27
  export class PBVision {
20
- constructor (apiKey, config = ENVIRONMENTS.test) {
28
+ constructor (apiKey, { useProdServer = false } = {}) {
21
29
  assert(apiKey && apiKey.length === 31 && apiKey.indexOf('_') === 10,
22
30
  `invalid API key: ${apiKey}`)
23
31
 
24
32
  this.apiKey = apiKey
33
+ const config = useProdServer ? ENVIRONMENTS.prod : ENVIRONMENTS.test
25
34
  this.server = config.apiServer
26
35
  this.isDev = config === ENVIRONMENTS.test
27
36
  }