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

@ripperts/poco-agent-embed

v0.1.2

Published

Zero-dependency SDK for embedding a Poco Agent conversation

Readme

Poco Agent Embed

将 Poco Agent 的对话、历史消息和产物预览嵌入第三方系统。SDK 不依赖 Vue 或 React,支持 ESM、CommonJS 和浏览器 Script 标签接入。

安装

pnpm add @ripperts/poco-agent-embed

SDK 需要在浏览器环境中挂载。第三方系统必须通过 getAccessToken 返回当前用户有效的 Poco 登录 token。

Vue 2

<template>
  <div ref="agentChat" style="height: 640px"></div>
</template>

<script>
import { mountAgentEmbed } from "@ripperts/poco-agent-embed";

export default {
  props: {
    getAccessToken: {
      type: Function,
      required: true,
    },
  },
  data() {
    return {
      agentEmbedController: null,
    };
  },
  mounted() {
    this.agentEmbedController = mountAgentEmbed({
      baseUrl: "https://poco.example.com",
      agentId: "<agent-id>",
      target: this.$refs.agentChat,
      getAccessToken: () => this.getAccessToken(),
    });
  },
  beforeDestroy() {
    if (this.agentEmbedController) {
      this.agentEmbedController.destroy();
    }
  },
};
</script>

Vue 3

<template>
  <div ref="agentChat" style="height: 640px"></div>
</template>

<script setup>
import { onBeforeUnmount, onMounted, ref } from "vue";
import { mountAgentEmbed } from "@ripperts/poco-agent-embed";

const props = defineProps({
  getAccessToken: {
    type: Function,
    required: true,
  },
});
const agentChat = ref(null);
let agentEmbedController;

onMounted(() => {
  agentEmbedController = mountAgentEmbed({
    baseUrl: "https://poco.example.com",
    agentId: "<agent-id>",
    target: agentChat.value,
    getAccessToken: () => props.getAccessToken(),
  });
});

onBeforeUnmount(() => {
  if (agentEmbedController) {
    agentEmbedController.destroy();
  }
});
</script>

React

import { useEffect, useRef } from "react";
import { mountAgentEmbed } from "@ripperts/poco-agent-embed";

interface AgentChatProps {
  getAccessToken: () => string | Promise<string>;
}

export function AgentChat({ getAccessToken }: AgentChatProps) {
  const targetRef = useRef<HTMLDivElement>(null);

  useEffect(() => {
    if (!targetRef.current) return;

    const controller = mountAgentEmbed({
      baseUrl: "https://poco.example.com",
      agentId: "<agent-id>",
      target: targetRef.current,
      getAccessToken,
    });

    return () => controller.destroy();
  }, [getAccessToken]);

  return <div ref={targetRef} style={{ height: 640 }} />;
}

浏览器支持

支持现代 Chrome、Edge、Firefox 和 Safari。Vue 2 项目可以正常接入,但不支持 Internet Explorer 11。

完整参数和安全配置请参阅 Agent 外部嵌入文档。