Skip to content

gramiojs/posthog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Posthog plugin for GramIO

Resources

License

Stars

Watchers

Forks

Packages

No packages published