← Back to setup
Set it up yourself.
Preview only. This fictional project cannot connect to TaskUp.
1. Install
Terminal
npm install @taskup/web@0.2.82. Connect once
Save TaskUpClient.tsx in your components folder and render <TaskUpClient /> once in app/layout.tsx. Keep the layout as a server component.
Browser integration
"use client";
import { useEffect, useRef } from "react";
import { usePathname } from "next/navigation";
import { useTaskUp } from "@taskup/web/react";
export function TaskUpClient() {
const pathname = usePathname();
const previousPath = useRef<string | null>(null);
const taskup = useTaskUp({
projectKey: "YOUR_PUBLIC_PROJECT_KEY",
endpoint: "https://task-up.org",
usage: true,
version: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,
});
useEffect(() => {
if (!pathname) return;
if (previousPath.current !== null && previousPath.current !== pathname) taskup.trackPageView();
previousPath.current = pathname;
}, [pathname, taskup]);
// Use taskup in the components that handle the selected actions below.
return null;
}Report failed requests
Use this wrapper for the app requests you want to monitor.
App request
const response = await taskup.fetch("/api/your-action");Check the connection
Deploy your app and return to Setup. Report one temporary test error to verify Monitor, then remove it.
Temporary error check
taskup.reportError(new Error("TaskUp setup test"));