@yshop-sdk/vue
v1.0.7
Published
Vue 3 integration layer for YShop SDK.
Readme
@yshop-sdk/vue
Vue 3 integration layer for YShop SDK.
This package wraps @yshop/sdk-core and provides Vue-friendly composables, plugin installation, and reactive state handling.
📦 Installation
pnpm add @yshop/sdk-vue @yshop/sdk-core🚀 Setup
1. Install plugin
import { createApp } from "vue";
import App from "./App.vue";
import { createYShop } from "@yshop/sdk-vue";
const app = createApp(App);
app.use(
createShopPlugin({
baseUrl: "https://api.yshop.pl/v4",
publicKey: "your-public-api-key",
})
);
app.mount("#app");🧠 Usage in components
useShopClient
import { useShopClient } from "@yshop-sdk/vue";
const { shop, servers } = useShopClient();
const shopInfo = await shop.get();OR
import { useServers, useServer, .... } from "@yshop-sdk/vue";
// You can use composable for specific endpoint🔌 Features
- Vue 3 plugin (
app.use) - Reactive SDK access
- Typed API from
@yshop-sdk/core - Composition API support
- SSR-friendly design
🧠 Design principles
- Thin Vue wrapper over core SDK
- No business logic duplication
- Fully type-safe integration
- Minimal runtime overhead
MIT © YShop
