@behio/storefront-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 +30 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
# @behio/storefront-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Build your own e-shop. Keep 100% control over the frontend.**
|
|
4
|
+
|
|
5
|
+
Behio is a headless e-commerce platform that gives you a complete backend — products, inventory, orders, customers, discounts, multi-currency, multi-language, payments — and lets *you* design the storefront however you want. No themes, no templates, no vendor lock-in.
|
|
6
|
+
|
|
7
|
+
This SDK is the fastest way to connect your Next.js, React, or any JavaScript app to the Behio Storefront API.
|
|
8
|
+
|
|
9
|
+
## Why Behio?
|
|
10
|
+
|
|
11
|
+
- **You own the frontend.** Build it in Next.js, Astro, Nuxt, SvelteKit, React Native — or use plain HTML. The backend doesn't care.
|
|
12
|
+
- **Production-ready e-commerce backend in minutes.** Product catalog, cart, checkout, customer accounts, orders, tracking, CMS pages, discount codes, volume pricing, multi-warehouse inventory — all included.
|
|
13
|
+
- **Built for developers.** Type-safe, auto-completing, fully documented. Modern React hooks with TanStack Query under the hood. Automatic token refresh, optimistic cart updates, SSR prefetch support.
|
|
14
|
+
- **Scale-ready.** Redis caching, rate limiting, webhooks, API keys with scoped permissions. From MVP to millions of orders on the same stack.
|
|
15
|
+
- **Admin UI you don't have to build.** Behio comes with a full admin dashboard for managing products, orders, customers, CMS content, and analytics. You focus on the customer experience.
|
|
16
|
+
|
|
17
|
+
**Perfect for:**
|
|
18
|
+
- Agencies building custom e-shops for clients
|
|
19
|
+
- Brands that want their storefront to look and feel unique
|
|
20
|
+
- SaaS apps that need built-in commerce
|
|
21
|
+
- Headless migrations from Shopify, WooCommerce, PrestaShop
|
|
22
|
+
|
|
23
|
+
## Get started
|
|
4
24
|
|
|
5
25
|
```bash
|
|
6
26
|
npm install @behio/storefront-sdk
|
|
@@ -330,7 +350,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
330
350
|
return (
|
|
331
351
|
<BehioProvider
|
|
332
352
|
apiKey={process.env.NEXT_PUBLIC_BEHIO_API_KEY!}
|
|
333
|
-
baseUrl=
|
|
353
|
+
baseUrl={process.env.NEXT_PUBLIC_BEHIO_API_URL} // optional — defaults to https://api.behio.com
|
|
334
354
|
locale="cs"
|
|
335
355
|
currency="CZK"
|
|
336
356
|
storage="cookies" // "cookies" | "localStorage" | "memory"
|
|
@@ -356,7 +376,14 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|
|
356
376
|
}
|
|
357
377
|
```
|
|
358
378
|
|
|
359
|
-
|
|
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"`:
|
|
360
387
|
```typescript
|
|
361
388
|
async rewrites() {
|
|
362
389
|
return [{ source: '/api/:path*', destination: 'https://api.behio.com/:path*' }];
|