
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@raideno/convex-analytics
Advanced tools
Convex agnostic analytics package. Compatible with posthog, discord webhooks, mail alerts, etc.
npm install @raideno/convex-analytics
convex/schema.ts
import { analyticsTables } from "@raideno/convex-analytics/server";
import { defineSchema } from "convex/server";
export default defineSchema({
...analyticsTables,
/*
* Your app tables...
*/
});
convex/analytics.ts
import { internalConvexAnalytics } from "@raideno/convex-analytics/server";
import { DiscordProcessorFactory } from "@raideno/convex-analytics/processors/discord";
import { PosthogProcessorFactory } from "@raideno/convex-analytics/processors/posthog";
import configuration from "./analytics.config";
export const { store, analytics, process } = internalConvexAnalytics({
processors: [
/*
* Will only capture events named "demo_perform_action".
*/
DiscordProcessorFactory({
url: process.env.DISCORD_WEBHOOK_URL!,
events: ["demo_perform_action"],
}),
/*
* Will capture all events.
*/
PosthogProcessorFactory({
key: process.env.POSTHOG_KEY!,
host: "https://us.i.posthog.com",
events: ["*"],
}),
],
processEveryK: 1,
});
convex/actions.ts
/*
* Imports
*/
import { analytics } from "./analytics"
export const perform = action({
args: {
value: v.optional(v.string()),
},
handler: async (context, args) => {
/*
* ...
*/
await analytics.track(
context as unknown as GenericActionCtx<AnyDataModel>,
{
name: "demo_perform_action",
distinctId: userId,
properties: {
value: args.value || "no_value",
},
}
);
/*
* ...
*/
},
});
You can also provide custom processors by implementing the Processor interface from @raideno/convex-analytics/processors.
export const { store, analytics, process } = internalConvexAnalytics({
processors: [
{
events: ["*"],
/*
* Receives an action context and a batch of events of up to `processEveryK`.
* Must return the list of processed event IDs.
*/
handler: async (context, events) => {
console.log(
"[events]:",
events.map((e) => e.name)
);
return events.map((e) => e._id);
},
} as Processor,
],
processEveryK: 1,
});
An example app can be found in the demo package.
FAQs
Easily integrate analytics into your convex backend.
The npm package @raideno/convex-analytics receives a total of 82 weekly downloads. As such, @raideno/convex-analytics popularity was classified as not popular.
We found that @raideno/convex-analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.