@behio/storefront-sdk 0.1.2 → 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.
Files changed (2) hide show
  1. package/README.md +9 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -350,7 +350,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
350
350
  return (
351
351
  <BehioProvider
352
352
  apiKey={process.env.NEXT_PUBLIC_BEHIO_API_KEY!}
353
- baseUrl="/api" // Next.js proxy to avoid CORS
353
+ baseUrl={process.env.NEXT_PUBLIC_BEHIO_API_URL} // optional defaults to https://api.behio.com
354
354
  locale="cs"
355
355
  currency="CZK"
356
356
  storage="cookies" // "cookies" | "localStorage" | "memory"
@@ -376,7 +376,14 @@ export default function RootLayout({ children }: { children: React.ReactNode })
376
376
  }
377
377
  ```
378
378
 
379
- Next.js rewrite in `next.config.ts`:
379
+ ```bash
380
+ # .env.local
381
+ NEXT_PUBLIC_BEHIO_API_KEY=pk_live_xxx
382
+ NEXT_PUBLIC_BEHIO_API_URL=https://api.behio.com # production
383
+ # NEXT_PUBLIC_BEHIO_API_URL=http://localhost:7007 # local dev
384
+ ```
385
+
386
+ **Optional:** If you prefer to hide the backend URL behind a proxy, add a Next.js rewrite in `next.config.ts` and set `baseUrl="/api"`:
380
387
  ```typescript
381
388
  async rewrites() {
382
389
  return [{ source: '/api/:path*', destination: 'https://api.behio.com/:path*' }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behio/storefront-sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "TypeScript SDK for Behio Headless E-Shop — core client + React hooks",
5
5
  "author": "Behio",
6
6
  "license": "MIT",