@yshop-sdk/core
v1.0.3
Published
Core SDK for YShop. This package contains the main API layer and business logic used by all platform adapters (Vue, future React, Node, etc.).
Downloads
444
Readme
@yshop-sdk/core
Core SDK for YShop. This package contains the main API layer and business logic used by all platform adapters (Vue, future React, Node, etc.).
It is framework-agnostic and designed to be imported anywhere.
📦 Installation
npm install @yshop-sdk/core🚀 Features
- Lightweight core API client
- Type-safe TypeScript SDK
- Framework-agnostic design
- Shared request/response models
- Extensible architecture for adapters (Vue, React, etc.)
🧠 Usage
Basic usage
import { createShopClient } from "@yshop-sdk/core";
const client = createShopClient({
baseUrl: "https://api.yshop.com",
apiKey: "your-api-key",
});
const shop = await client.shop.get();
console.log(shop);⚙️ Configuration
type ShopClientConfig = {
baseUrl: string;
apiKey?: string;
version: "v4"
};📡 API
Shop
- client.shop.get()
- client.shop.useVoucher()
- client.shop.getLastBuyers(limit?, serverId?)
- client.shop.getRichestPlayers()
Servers
- client.servers.list()
- client.servers.get(id)
🔌 Adapters
- @yshop-sdk/vue
📤 Publish
pnpm changeset pnpm changeset version pnpm changeset publish
MIT © YShop
