Getting Started with Cruxstack
Welcome to Cruxstack! This guide will help you understand what Cruxstack is, why it's useful, and how to get started quickly with either our Node.js or Browser SDK.
What is Cruxstack?
Cruxstack is a User Intelligence Infrastructure (UII) that turns raw user activity into predictive, real-time traits — like likely_to_churn, power_user, and ready_to_upgrade.
With just a few lines of code, you can power inside-the-app personalization, churn prevention, and upgrade nudges — without building ML pipelines.
Our plug-and-play SDKs, adaptive ML engine, and real-time APIs give product teams the superpowers of a full data science team — no model training, no complex setup.
How It Works
Cruxstack automatically handles everything after you send an event:
- Event Collection SDKs: Capture user behavior across multiple platforms (web, server, mobile)
- Event Processing Pipeline: Enrich and validate events automatically — includes timestamping, UUIDs, platform tagging, and schema checks
- ML Trait Engine: Transforms raw events into predictive user traits (e.g., churn risk, power user)
- Analytics APIs: Access trait-level data and event insights via real-time APIs and dashboards
Why Choose Cruxstack?
🧠 No ML expertise required – Use ML-powered traits out-of-the-box
🧩 Drop-in SDKs – Integrate in minutes with minimal code
📈 Predictive traits – Go beyond events to understand intent
🏗️ Built for scale – Proven reliability for enterprise environments
⏱️ Real-time engine – Traits stream instantly for in-app decisions
Quick Start Guide
Step 1: Choose Your Platform
Platform | Use Case | Framework Support | Status |
---|---|---|---|
Node.js | Server-side applications | Express, Fastify, Koa | ✅ Production Ready |
Browser | Web applications | React, Vue, Angular, Plain JS | ✅ Production Ready |
React Native | Mobile apps | React Native | 🚧 Coming Soon |
Android | Native Android apps | Native Android | 🚧 Coming Soon |
Step 2: Install the SDK
For Node.js applications:
npm install @cruxstack/node-sdk
For Browser applications:
npm install @cruxstack/browser-sdk
Step 3: Initialize and Track
Node.js Example:
import { init, cruxTrack } from "@cruxstack/node-sdk";
// Initialize the SDK
init({
appId: "your-app-id-123",
});
// Track your first event
await cruxTrack("user_signup", {
userId: "user123",
email: "[email protected]",
source: "organic_search",
});
Browser Example:
import { cruxstack } from "@cruxstack/browser-sdk";
// Initialize the SDK
await cruxstack.init({
appId: "your-app-id",
userId: "user123",
autoCapture: true,
});
// Track a custom event
await cruxstack.trackCustom("button_clicked", {
buttonName: "signup",
page: "landing",
});
Step 4: Framework-Specific Examples
React Applications:
import React, { useEffect } from "react";
import { cruxstack } from "@cruxstack/browser-sdk";
function App() {
useEffect(() => {
cruxstack.init({
appId: "your-app-id",
userId: "user123",
autoCapture: true,
});
}, []);
const handleClick = async () => {
await cruxstack.trackCustom("button_clicked", {
buttonName: "signup",
});
};
return <button onClick={handleClick}>Sign Up</button>;
}
Vue.js Applications:
<template>
<button @click="trackEvent">Sign Up</button>
</template>
<script>
import { cruxstack } from "@cruxstack/browser-sdk";
export default {
async mounted() {
await cruxstack.init({
appId: "your-app-id",
userId: "user123",
});
},
methods: {
async trackEvent() {
await cruxstack.trackCustom("button_clicked", {
buttonName: "signup",
});
},
},
};
</script>
Angular Applications:
import { Component, OnInit } from "@angular/core";
import { cruxstack } from "@cruxstack/browser-sdk";
@Component({
selector: "app-signup",
template: '<button (click)="trackEvent()">Sign Up</button>',
})
export class SignupComponent implements OnInit {
async ngOnInit() {
await cruxstack.init({
appId: "your-app-id",
userId: "user123",
});
}
async trackEvent() {
await cruxstack.trackCustom("button_clicked", {
buttonName: "signup",
});
}
}
Express.js Applications (Node.js):
import express from "express";
import { init, cruxTrack } from "@cruxstack/node-sdk";
const app = express();
// Initialize the SDK
init({ appId: "your-app-id-123" });
app.post("/api/signup", async (req, res) => {
// Track the signup event
await cruxTrack("user_signup", {
userId: req.body.email,
email: req.body.email,
source: req.body.source,
});
res.json({ success: true });
});
Real-World Examples
Churn Prevention
Browser SDK (Frontend):
// Track the complete purchase journey
await cruxstack.trackCustom("session_abandoned", { duration: 20 });
await cruxstack.trackCustom("support_article_viewed", { topic: "cancellation_policy" });
await cruxstack.trackCustom("plan_downgraded", { previousPlan: "Pro", newPlan: "Basic" });
Node.js SDK (Backend):
// Server-side purchase tracking
await cruxTrack("session_abandoned", {
userId: "user123",
orderId: "order_789",
totalAmount: 299.99,
paymentMethod: "credit_card",
});
User Engagement
Browser SDK (Frontend):
// Monitor feature usage
await cruxstack.trackCustom("feature_activated", {
feature: "advanced_analytics",
});
await cruxstack.trackCustom("feature_used", {
feature: "data_export",
duration: 45000,
});
Node.js SDK (Backend):
// Server-side feature tracking
await cruxTrack("feature_activated", {
userId: "user123",
feature: "api_access",
});
Conversion Optimization
Browser SDK (Frontend):
// Track conversion funnel
await cruxstack.trackCustom("user_signup_started", {
source: "google_ads",
});
await cruxstack.trackCustom("onboarding_completed", {
stepsCompleted: 5,
});
Node.js SDK (Backend):
// Server-side conversion tracking
await cruxTrack("subscription_started", {
userId: "user123",
plan: "premium",
});
Next Steps
📖 Learn More
- Node.js SDK Guide: Detailed setup and usage
- Browser SDK Guide: Web application integration
- Node.js API Reference: Complete Node.js SDK documentation
- Browser API Reference: Complete Browser SDK documentation
🎯 Best Practices
- Guides: Real-world examples and patterns
- Event Enrichment: Understanding event processing
- Error Handling: Robust implementation strategies
🛠 Advanced Topics
- Types & Interfaces: TypeScript definitions
- Advanced Usage: Custom configurations
- Troubleshooting: Common issues and solutions
Ready to dive deeper? Choose your platform: Node.js SDK or Browser SDK, or explore our comprehensive guides for practical examples and best practices.