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

@rongcloud/embed-console-sdk

v0.0.1-beta.2

Published

一个用于嵌入融云控制台组件的 JavaScript SDK,支持在网页中动态加载和管理融云控制台的 iframe 组件。

Readme

@rongcloud/embed-console-sdk

一个用于嵌入融云控制台组件的 JavaScript SDK,支持在网页中动态加载和管理融云控制台的 iframe 组件。

安装

npm install @rongcloud/embed-console-sdk

基本用法

1. 引入 SDK

// ES6 模块
import RC from '@rongcloud/embed-console-sdk';

// UMD (通过 script 标签引入)
<script src="https://cdn.ronghub.com/embed/console/embed-v0.0.1.js"></script>
// 全局变量 RC 可用

2. 初始化组件

// 创建一个 RC 实例
const instance =  RC.init(
  'my-container',        // 容器元素 ID
  'https://console.rongcloud.cn/...' // 访问令牌
);

3. HTML 容器

<!-- 在 HTML 中准备容器元素 -->
<div id="my-container" style="width: 100%; height: 500px;"></div>

API 参考

RC 主对象

RC.init(containerId, accessToken)

创建并初始化一个新的 RC 实例。

参数:

  • containerId (string): 容器元素的 ID
  • accessToken (string): 访问令牌 URL
  • showMenu (boolean): 是否显示菜单

返回: Promise<RCInstance>

const instance = RC.init('container', 'access token', true);

RC.getEventNames()

获取所有可用的事件名称。

返回: string[]

const events = RC.getEventNames();
console.log('可用事件:', events); // ['expired', 'initError']

RCInstance 实例方法

instance.on(eventType, handler)

监听事件

参数:

  • eventType (string): 事件类型
  • handler (function): 事件处理函数

返回: RCInstance

instance.on(RC.EVENTS.EXPIRED, (event) => {
  console.log('Token 已过期:', event);
  // 处理 token 过期逻辑
});

instance.destory()

销毁实例

instance.destory();

浏览器兼容性

支持现代浏览器,需要 ES6+ 和 postMessage API 支持。

常见问题

Safari 浏览器 无法使用

Safari 浏览器需要在设置 -> 隐私 ,关闭防止跨站跟踪