@gramio/posthog
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Posthog

npm npm downloads JSR JSR Score

import { PostHog } from "posthog-node";
import { posthogPlugin } from "@gramio/posthog";
import { Bot } from "gramio";

const posthog = new PostHog(process.env.POSTHOG_API_KEY!, {
    host: process.env.POSTHOG_HOST,
});

const bot = new Bot(process.env.BOT_TOKEN!)
    .extend(posthogPlugin(posthog))
    .on("message", (context) => {
        context.capture("message", {
            text: context.message.text,
        });

        throw new Error("Will be captured by PostHog");
    });

await bot.start();

For better documentation, see the GramIO - PostHog.

Package Sidebar

Install

npm i @gramio/posthog

Weekly Downloads

53

Version

0.0.2

License

MIT

Unpacked Size

363 kB

Total Files

7

Last publish

Collaborators

  • skravets