@vio-live/web-sdk 0.2.0 → 0.4.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 +29 -2
- package/dist/chunk-NP2KCM7X.js +3859 -0
- package/dist/chunk-NP2KCM7X.js.map +1 -0
- package/dist/chunk-PBQSHIID.js +3 -0
- package/dist/{chunk-GGM2AIK5.js.map → chunk-PBQSHIID.js.map} +1 -1
- package/dist/{chunk-7JSSYPRN.js → chunk-V5ZQG2H5.js} +1419 -169
- package/dist/chunk-V5ZQG2H5.js.map +1 -0
- package/dist/core/index.d.ts +314 -12
- package/dist/core/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +3 -2
- package/dist/react/index.js.map +1 -1
- package/dist/tokens-CvqQYURw.d.ts +555 -0
- package/dist/ui/index.d.ts +3 -83
- package/dist/ui/index.js +5 -132
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-7JSSYPRN.js.map +0 -1
- package/dist/chunk-GGM2AIK5.js +0 -3
- package/dist/chunk-SOO2G6CF.js +0 -1618
- package/dist/chunk-SOO2G6CF.js.map +0 -1
- package/dist/vio-checkout-CrC5tvmh.d.ts +0 -300
package/README.md
CHANGED
|
@@ -24,10 +24,37 @@ import '@vio-live/web-sdk/ui' // registers <vio-product-carousel>, <vio-cart>,
|
|
|
24
24
|
|
|
25
25
|
Vio.init({
|
|
26
26
|
apiKey: import.meta.env.VITE_VIO_API_KEY,
|
|
27
|
-
|
|
27
|
+
environment: 'production', // 'development' | 'testing' | 'production'
|
|
28
28
|
})
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
`environment` is the recommended way to configure — it resolves the right
|
|
32
|
+
`apiBase`/`graphQLBase` for you (each environment has known-good defaults
|
|
33
|
+
baked in). Note the middle value is **`'testing'`, not `'staging'`**
|
|
34
|
+
(naming kept in parity with the iOS SDK).
|
|
35
|
+
|
|
36
|
+
Only pass `apiBase`/`graphQLBase`/`stripePublishableKey` directly if you need
|
|
37
|
+
to override those specific values — e.g. a self-hosted proxy, or a Stripe key
|
|
38
|
+
that differs from the environment default:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
Vio.init({
|
|
42
|
+
apiKey: '…',
|
|
43
|
+
environment: 'production',
|
|
44
|
+
apiBase: 'https://my-proxy.example.com', // optional, overrides the environment default
|
|
45
|
+
graphQLBase: 'https://my-graphql.example.com', // optional — note the casing: graphQLBase
|
|
46
|
+
stripePublishableKey: 'pk_live_…', // optional — needed for the Apple Pay button
|
|
47
|
+
})
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Apple Pay note**: the button only renders when `canMakePayment()` says the
|
|
51
|
+
device+browser can pay AND your domain is verified for Apple Pay in Stripe's
|
|
52
|
+
dashboard (Settings → Payment method domains) — Stripe serves a verification
|
|
53
|
+
file at `/.well-known/apple-developer-merchantid-domain-association` on that
|
|
54
|
+
domain. Not all hosts let you serve that file (some page builders can't) —
|
|
55
|
+
if the button never appears, check domain verification before assuming it's
|
|
56
|
+
a code bug.
|
|
57
|
+
|
|
31
58
|
```html
|
|
32
59
|
<vio-product-carousel
|
|
33
60
|
label="Ukens funn"
|
|
@@ -51,7 +78,7 @@ Typed wrappers (built on `@lit/react`). Importing this entry **registers the ele
|
|
|
51
78
|
import { Vio } from '@vio-live/web-sdk'
|
|
52
79
|
import { VioProductCarousel, VioCart } from '@vio-live/web-sdk/react'
|
|
53
80
|
|
|
54
|
-
Vio.init({ apiKey: '…' })
|
|
81
|
+
Vio.init({ apiKey: '…', environment: 'production' })
|
|
55
82
|
|
|
56
83
|
function Shop() {
|
|
57
84
|
return (
|