npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sdkwork/app-sdk

v1.0.18

Published

sdkwork-app-sdk

Downloads

463

Readme

sdkwork-app-sdk

Professional TypeScript SDK for SDKWork API.

Installation

npm install @sdkwork/app-sdk
# or
yarn add @sdkwork/app-sdk
# or
pnpm add @sdkwork/app-sdk

Quick Start

import { SdkworkAppClient } from '@sdkwork/app-sdk';

const client = new SdkworkAppClient({
  baseUrl: 'http://localhost:8080',
  timeout: 30000,
});

// Mode A: API Key (recommended for server-to-server calls)
client.setApiKey('your-api-key');

// Use the SDK
const result = await client.tenant.getTenantTypes();

Authentication Modes (Mutually Exclusive)

Choose exactly one mode for the same client instance.

Mode A: API Key

const client = new SdkworkAppClient({ baseUrl: 'http://localhost:8080' });
client.setApiKey('your-api-key');
// Sends: Authorization: Bearer <apiKey>

Mode B: Dual Token

const client = new SdkworkAppClient({ baseUrl: 'http://localhost:8080' });
client.setAuthToken('your-auth-token');
client.setAccessToken('your-access-token');
// Sends:
// Authorization: Bearer <authToken>
// Access-Token: <accessToken>

Do not call setApiKey(...) together with setAuthToken(...) + setAccessToken(...) on the same client.

Configuration (Non-Auth)

import { SdkworkAppClient } from '@sdkwork/app-sdk';

const client = new SdkworkAppClient({
  baseUrl: 'http://localhost:8080',
  timeout: 30000, // Request timeout in ms
  headers: {      // Custom headers
    'X-Custom-Header': 'value',
  },
});

API Modules

  • client.workspace - workspace API
  • client.voiceSpeaker - voice_speaker API
  • client.video - video API
  • client.user - user API
  • client.tool - tool API
  • client.tenant - tenant API
  • client.social - social API
  • client.skill - skill API
  • client.shop - shop API
  • client.share - share API
  • client.setting - setting API
  • client.prompt - prompt API
  • client.project - project API
  • client.product - product API
  • client.partner - partner API
  • client.notification - notification API
  • client.note - note API
  • client.news - news API
  • client.music - music API
  • client.knowledgeBase - knowledge_base API
  • client.invoice - invoice API
  • client.image - image API
  • client.generation - generation API
  • client.filesystem - filesystem API
  • client.feedback - feedback API
  • client.favorite - favorite API
  • client.drive - drive API
  • client.document - document API
  • client.dashboard - dashboard API
  • client.collection - collection API
  • client.chat - chat API
  • client.character - character API
  • client.category - category API
  • client.cart - cart API
  • client.asset - asset API
  • client.app - app API
  • client.announcement - announcement API
  • client.agent - agent API
  • client.advert - advert API
  • client.wallet - wallet API
  • client.vote - vote API
  • client.vip - vip API
  • client.upload - upload API
  • client.search - search API
  • client.rtc - rtc API
  • client.payment - payment API
  • client.organization - organization API
  • client.order - order API
  • client.ordering - ordering API
  • client.model - model API
  • client.history - history API
  • client.game - game API
  • client.feed - feed API
  • client.email - email API
  • client.currency - currency API
  • client.coupon - coupon API
  • client.comment - comment API
  • client.claw - claw API
  • client.billing - billing API
  • client.auth - auth API
  • client.audit - audit API
  • client.analytic - analytic API
  • client.activity - activity API
  • client.account - account API
  • client.abtest - abtest API
  • client.skus - skus API

Usage Examples

workspace

// 获取工作空间列表
const result = await client.workspace.listWorkspaces();

voice_speaker

// 获取发音人统计
const result = await client.voiceSpeaker.getStatistics();

video

// 获取视频统计
const result = await client.video.getVideoStatistics();

user

// 获取用户设置
const result = await client.user.getUserSettings();

tool

// List my tools
const result = await client.tool.listMine();

tenant

// 获取租户类型列表
const result = await client.tenant.getTenantTypes();

social

// 获取好友申请列表
const result = await client.social.listFriendRequests();

skill

// List skill packages
const result = await client.skill.listPackages();

shop

// 获取店铺统计
const result = await client.shop.getStatistics();

share

// 获取分享平台配置
const result = await client.share.getSharePlatforms();

setting

// 获取界面设置
const result = await client.setting.getUi();

prompt

// 获取热门提示语
const params = {} as Record<string, any>;
const result = await client.prompt.getPopularPrompts(params);

project

// 最近访问项目
const params = {} as Record<string, any>;
const result = await client.project.listRecentProjects(params);

product

// 获取商品分类树
const result = await client.product.getProductCategoryTree();

partner

// Get partner statistics
const result = await client.partner.getPartnerStatistics();

notification

// Get notification settings
const result = await client.notification.getNotificationSettings();

note

// Notes API
const result = await client.note.listFolders();

news

// 获取我的新闻
const params = {} as Record<string, any>;
const result = await client.news.getMy(params);

music

// 获取音乐统计
const result = await client.music.getMusicStatistics();

knowledge_base

// Batch delete knowledge documents
const knowledgeBaseId = 1;
const result = await client.knowledgeBase.batchDeleteKnowledgeDocuments(knowledgeBaseId);

invoice

// 获取发票统计
const result = await client.invoice.getInvoiceStatistics();

image

// 获取图片统计
const result = await client.image.getImageStatistics();

generation

// 获取风格类型列表
const result = await client.generation.getStyleTypes();

filesystem

// List disks
const result = await client.filesystem.listDisks();

feedback

// 客服信息
const result = await client.feedback.getSupportInfo();

favorite

// 收藏夹列表
const result = await client.favorite.listFavoriteFolders();

drive

// Clear drive trash
const result = await client.drive.clearTrash();

document

// Batch delete documents
const result = await client.document.batchDeleteDocuments();

dashboard

// 快捷入口
const result = await client.dashboard.getShortcuts();

collection

// 获取合集树
const params = {} as Record<string, any>;
const result = await client.collection.getCollectionTree(params);

chat

// 获取会话列表
const params = {} as Record<string, any>;
const result = await client.chat.listSessions(params);

character

// 获取热门角色
const params = {} as Record<string, any>;
const result = await client.character.getPopularCharacters(params);

category

// 获取分类类型
const result = await client.category.getCategoryTypes();

cart

// Get cart items
const result = await client.cart.getCartItems();

asset

// 获取文件夹列表
const result = await client.asset.listFolders();

app

// Get app statistics
const result = await client.app.getAppStatistics();

announcement

// 未读公告
const result = await client.announcement.getUnreadAnnouncements();

agent

// List agents
const params = {} as Record<string, any>;
const result = await client.agent.getList(params);

advert

// 广告设置
const result = await client.advert.getAdvertSettings();

wallet

// Get wallet overview
const result = await client.wallet.getOverview();

vote

// 获取我的投票历史
const params = {} as Record<string, any>;
const result = await client.vote.getMyVotes(params);

vip

// 获取VIP状态
const result = await client.vip.getVipStatus();

upload

// 获取存储使用情况
const result = await client.upload.getStorageUsage();

search

// 搜索统计
const result = await client.search.getSearchStatistics();

rtc

// List RTC records
const params = {} as Record<string, any>;
const result = await client.rtc.listRecords(params);

payment

// Get payment statistics
const result = await client.payment.getPaymentStatistics();

organization

// 获取组织统计
const result = await client.organization.getOrganizationStatistics();

order

// Get order statistics
const result = await client.order.getOrderStatistics();

ordering

// Get menu categories
const result = await client.ordering.getMenuCategories();

model

// Get model types
const result = await client.model.getModelTypes();

history

// 历史统计
const result = await client.history.getHistoryStatistics();

game

// 获取我的荣誉
const params = {} as Record<string, any>;
const result = await client.game.listHonors(params);

feed

// Get top feeds
const params = {} as Record<string, any>;
const result = await client.feed.getTopFeeds(params);

email

// Get SaaS managed email account config
const result = await client.email.getAccountConfig();

currency

// 获取货币类型列表
const result = await client.currency.getCurrencyTypes();

coupon

// 获取优惠券统计
const result = await client.coupon.getStatistics();

comment

// 获取我的评论
const params = {} as Record<string, any>;
const result = await client.comment.getMyComments(params);

claw

// Get claw bootstrap
const result = await client.claw.bootstrap();

billing

// 预扣冻结
const body = {} as any;
const result = await client.billing.prehold(body);

auth

// 生成登录二维码
const result = await client.auth.generateQrCode();

audit

// 敏感词库
const result = await client.audit.listSensitiveWord();

analytic

// 使用统计
const result = await client.analytic.getUserUsageStats();

activity

// 获取抽奖列表
const result = await client.activity.listLotteryActivities();

account

// Get account summary
const result = await client.account.getAccountSummary();

abtest

// 所有特性开关
const result = await client.abtest.listFeatureFlags();

skus

// 检查SKU编码是否存在
const params = {} as Record<string, any>;
const result = await client.skus.checkSkuCodeExists(params);

Error Handling

import { SdkworkAppClient, NetworkError, TimeoutError, AuthenticationError } from '@sdkwork/app-sdk';

try {
  const result = await client.tenant.getTenantTypes();
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Authentication failed:', error.message);
  } else if (error instanceof TimeoutError) {
    console.error('Request timed out:', error.message);
  } else if (error instanceof NetworkError) {
    console.error('Network error:', error.message);
  } else {
    throw error;
  }
}

Publishing

This SDK includes cross-platform publish scripts in bin/:

  • bin/publish-core.mjs
  • bin/publish.sh
  • bin/publish.ps1

Check

./bin/publish.sh --action check

Publish

./bin/publish.sh --action publish --channel release
.\bin\publish.ps1 --action publish --channel test --dry-run

Set NPM_TOKEN (and optional NPM_REGISTRY_URL) before release publish.

License

MIT