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 🙏

© 2025 – Pkg Stats / Ryan Hefner

uapi-browser-sdk

v0.1.3

Published

![Banner](https://raw.githubusercontent.com/AxT-Team/uapi-browser-sdk/main/banner.png)

Downloads

34

Readme

uapi-browser-sdk

Banner

Browser TS Docs npm

[!NOTE] 所有接口的 Browser (TypeScript) 示例都可以在 UApi 的接口文档页面,向下滚动至 快速启动 区块后直接复制。

快速开始

npm i uapi-browser-sdk
import { UapiClient } from 'uapi-browser-sdk'

const client = new UapiClient('https://uapis.cn/api/v1')
const result = await client.social.getSocialQqUserinfo({ qq: '10001' })
console.log(result)

CDN 引入

uapi-browser-sdk 发布在 npm,因而可以直接通过常见 CDN 以 ES Module 方式加载。建议在生产环境固定版本号(@latest 仅用于快速试用)。

jsDelivr(推荐)

<script type="module">
  import { UapiClient } from 'https://cdn.jsdelivr.net/npm/uapi-browser-sdk@latest/dist/index.js';

  const client = new UapiClient('https://uapis.cn/api/v1');
  const data = await client.social.getSocialQqUserinfo({ qq: '10001' });
  console.log(data);
</script>

UNPKG(原生 ESM)

<script type="module">
  import { UapiClient } from 'https://unpkg.com/uapi-browser-sdk@latest/dist/index.js?module';
  // ...
</script>

ESM CDN(esm.run / esm.sh)

import { UapiClient } from 'https://esm.run/uapi-browser-sdk@latest';

三种 CDN 均会返回同一份浏览器模块,可按自己的缓存/区域策略选择。

特性

现在你不再需要反反复复的查阅文档了。

只需在 IDE 中键入 client.,所有核心模块——如 socialgameimage——即刻同步展现。进一步输入即可直接定位到 getSocialQqUserinfo 这样的具体方法,其名称与文档的 operationId 严格保持一致,确保了开发过程的直观与高效。

所有方法签名只接受真实且必需的参数。当你在构建请求时,TypeScript 会即时提示 qqusername 等键名,这彻底杜绝了在对象字面量中因键名拼写错误而导致的运行时错误。

针对 401、404、429 等标准 HTTP 响应,SDK 已将其统一映射为 UapiError。错误对象自带 codestatusdetails 字段,确保你在浏览器日志中能第一时间准确、快速地诊断问题。

SDK 采用原生 fetch,自动补上 Authorization 头且不依赖任何 Node.js API;需要自定义超时或重试时,只要包装 _request 或替换调用处即可。

如果你需要查看字段细节或内部逻辑,仓库中的 ./internal 目录同步保留了由 openapi-generator 生成的完整结构体,随时可供参考。

错误模型概览

| HTTP 状态码 | SDK 错误类型 | 附加信息 | |-------------|-------------|----------------------------------------------| | 401/403 | UapiError | codestatusdetails | | 404 | UapiError | codestatus | | 400 | UapiError | codestatusdetails | | 429 | UapiError | codestatusretry_after_seconds | | 5xx | UapiError | codestatus |

其他 SDK

| 语言 | 仓库地址 | |-------------|--------------------------------------------------------------| | Go | https://github.com/AxT-Team/uapi-sdk-go | | Python | https://github.com/AxT-Team/uapi-sdk-python | | TypeScript| https://github.com/AxT-Team/uapi-sdk-typescript | | Browser (TypeScript/JavaScript)(当前)| https://github.com/AxT-Team/uapi-browser-sdk | | Java | https://github.com/AxT-Team/uapi-sdk-java | | PHP | https://github.com/AxT-Team/uapi-sdk-php | | C# | https://github.com/AxT-Team/uapi-sdk-csharp | | C++ | https://github.com/AxT-Team/uapi-sdk-cpp | | Rust | https://github.com/AxT-Team/uapi-sdk-rust |

文档

访问 UApi文档首页 并选择任意接口,向下滚动到 快速启动 区块即可看到最新的 Browser (TypeScript) 示例代码。