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 🙏

© 2024 – Pkg Stats / Ryan Hefner

qer-generator-for-debug

v1.0.1

Published

A simple userSig generator for debug, don't use it in production environment.

Downloads

4

Readme

qer-generator-for-debug

简体中文 | English

介绍

在 JavaScript/TypeScript 中可以使用本仓库生成 UserSig

⚠️ 风险披露(请不要在生产环境使用)

使用本仓库生成 UserSig 时,需要传入您的应用密钥(SDKSecretKey),如果将其部署在前端的生产环境中(如网页前端代码/App),很容易被反编译逆向破解,一旦您的密钥泄露,攻击者就可以盗用您的腾讯云流量,因此该方法仅适合本地跑通功能调试

正式环境请在服务端部署,需要 UserSig 时由您的项目向业务服务器发起请求获取动态 UserSig,请访问:UserSig 生成

如何使用?

通过 npm 使用

安装

npm install -D qer-generator-for-debug

使用

import generateUserSigForDebug from 'qer-generator-for-debug';

// 应用 ID 和密钥的获取地址 https://console.cloud.tencent.com/trtc/app
const { userSig } = generateUserSigForDebug({
  SDKAppID: 10000000, // 替换为你的应用 ID
  SDKSecretKey: '<your_SDKSecretKey>', // 替换为你的应用密钥
  userId: '<your_userID>' // 字符串类型的用户名
});

console.log(userSig);

通过 CDN 使用

你可以借助 script 标签直接通过 CDN 引入 UMD 来使用:

<script src="https://unpkg.com/qer-generator-for-debug@latest/dist/user-signature-generator-for-debug.umd.min.js"></script>

这里使用了 unpkg,你也可以使用其他 CDN 服务商。

对于中国大陆地区用户,更建议下载改文件并且使用自己的服务,点此处下载 UMD 和 ESM

使用

<script src="https://unpkg.com/qer-generator-for-debug@latest/dist/user-signature-generator-for-debug.umd.min.js"></script>

<script>
  // 应用 ID 和密钥的获取地址 https://console.cloud.tencent.com/trtc/app
  const { userSig } = generateUserSigForDebug({
    SDKAppID: 10000000, // 替换为你的应用 ID
    SDKSecretKey: '<your_SDKSecretKey>', // 替换为你的应用密钥
    userId: '<your_userID>' // 字符串类型的用户名
  });

  console.log(userSig);
</script>