A TypeScript SDK for interacting with the Shopee Open API, maintained by the community.
npm install shopee-sdk
import { ShopeeClient } from "shopee-sdk";
// Initialize the client
const client = new ShopeeClient({
partner_id: 123456,
partner_key: "your-partner-key",
base_url: "https://partner.test-stable.shopeemobile.com", // For sandbox
// base_url: 'https://partner.shopeemobile.com', // For production
});
// Authenticate (if working with shop-level APIs)
await client.auth.getToken({
code: "authorization-code",
shop_id: 123456,
});
// Example: Get product list
const products = await client.product.getItemList({
offset: 0,
page_size: 10,
});
// Example: Add a voucher
const voucher = await client.voucher.addVoucher({
voucher_name: "Special Discount",
voucher_code: "SAVE10",
start_time: Math.floor(Date.now() / 1000),
end_time: Math.floor(Date.now() / 1000) + 7 * 24 * 60 * 60, // 7 days
voucher_type: 1, // shop voucher
reward_type: 1, // fixed amount
usage_quantity: 100,
min_basket_price: 20,
discount_amount: 10,
});
// Example: Get lost push messages (partner-level API, no auth required)
const lostMessages = await client.push.getLostPushMessage();
- TypeScript support with full type definitions
- Support for all Shopee Open API endpoints
- Authentication flow helpers
- Automatic token refresh
We use Conventional Commits for commit messages to automate versioning and release notes.
Examples of commit messages:
feat: add support for logistics API
- Minor version bumpfix: correct error handling in order API
- Patch version bumpdocs: update API documentation
- No version bumpfeat!: rename parameters in product API
orfeat: rename parameters in product API BREAKING CHANGE: ...
- Major version bump
This project uses Release Please to automate version management and releases.
The release process follows these steps:
- Commits to the main branch are automatically analyzed
- When conventional commit messages are detected, Release Please creates or updates a release PR
- When the release PR is merged:
- A new GitHub tag and release is created
- The package is automatically published to npm
- The CHANGELOG.md is updated with the release notes
MIT