@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 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
- // apiBase, graphqlBase, stripePublishableKey — optional overrides
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 (