SDK setup makes your product
slower to generate revenue.
SDK setup is a time-consuming hassle for both user and the company.
It often takes a months with endless back-and-forth emails.
Catch is a AI coding agent that install SDKs into user’s codebase.
Say goodbye to extensive documentation & back-and-forth emails.
Put this on your docs
This integration process should take approximately 2-3 hours for an experienced developer to implement and test thoroughly.
In Chat Artifact, how can I send an analytics event when the "expand ... lines" button is clicked?
Got it. I’ll add an Amplitude event for the "expand ... lines" button in the code diff section and update the apps/www/components/chat/right-artifact.tsx
file as follows:
This update includes:
handleExpand
to send an event when the "expand ... lines" button is clicked.onClick
handler to the span
from codeFoldMessageRenderer
to call handleExpand
.Now, clicking the button will trigger an 'Code Diff Expanded' event in Amplitude to analyze user behavior.
Could you change SDK token into 338862ce1d73453394fb1481f136e144
?
Sure, I’ll update the Amplitude SDK token to 338862ce1d73453394fb1481f136e144
.
1 | import * as amplitude from '@amplitude/analytics-browser'; | |
2 | import { useEffect } from 'react'; | |
3 | import { useAmplitudeUser } from '../hooks/useAmplitudeUser'; | |
7 | useEffect(() => { | |
8 | amplitude.init('338862ce1d73453394fb1481f136e144', { | |
9 | defaultTracking: { | |
10 | sessions: true, | |
11 | pageViews: true, | |
12 | formInteractions: true, | |
13 | fileDownloads: true, | |
14 | }, | |
15 | }); | |
16 | }, []); | |
17 | ||
18 | useAmplitudeUser(); | |
19 | ||
4 | 7 | useEffect(() => { |
This code initializes Amplitude with default tracking options for sessions, page views, form interactions, and file downloads. It's important to note that these settings will apply globally to all pages in the application. Consider the potential impact on performance and data collection volume, especially for high-traffic applications.
1 | import * as amplitude from '@amplitude/analytics-browser'; | |
10 | const handleExpand = (totalFoldedLines: number, fileName: string) => { | |
11 | amplitude.track('Code Diff Expanded', { | |
12 | category: 'Artifact', | |
13 | session_id: sessionId, | |
14 | project_id: project?.id, | |
15 | project_name: project?.productName, | |
16 | project_type: project?.type, | |
17 | file_name: fileName, | |
18 | expanded_lines: totalFoldedLines, | |
19 | version: version, | |
20 | }); | |
21 | }; | |
22 | ||
9 | 10 | const handleExpand = (totalFoldedLines: number, fileName: string) => { |
10 | 11 | amplitude.track('Code Diff Expanded', { |
11 | 12 | category: 'Artifact', |
12 | 13 | session_id: sessionId, |
13 | 14 | project_id: project?.id, |
14 | 15 | project_name: project?.productName, |
15 | 16 | project_type: project?.type, |
16 | 17 | file_name: fileName, |
17 | 18 | expanded_lines: totalFoldedLines, |
18 | 19 | version: version, |
19 | 20 | }); |
20 | 21 | }; |
21 | 22 | |
22 | 23 | return ( |
23 | 24 | <div className='flex-grow overflow-y-auto h-full'> |
24 | 25 | {exceptIdenticalPatchFiles.map((patchFile, idx) => ( |
25 | 26 | <div |
26 | 27 | className={cn( |
27 | 28 | 'catch-code-diff w-full overflow-x-auto border border-solid border-slate-200 rounded-lg', |
28 | 29 | '[&_pre]:!leading-[20px]', |
29 | 30 | )} |
30 | 31 | key={idx} |
31 | 32 | > |
32 | 33 | <MemoizedReactDiff |
33 | 34 | oldValue={patchFile.originalContent} |
1 | import { useEffect } from 'react'; | |
2 | import * as amplitude from '@amplitude/analytics-browser'; | |
3 | export function useAmplitudeUser() { | |
4 | useEffect(() => { | |
5 | const setUserProperties = async () => { | |
6 | const preferredLanguage = navigator.language || 'en-US'; | |
7 | const lastLoginDate = new Date().toISOString(); | |
8 | amplitude.identify(new amplitude.Identify() | |
9 | .set('preferredLanguage', preferredLanguage) | |
10 | .set('lastLoginDate', lastLoginDate) | |
11 | ); | |
12 | }; | |
13 | setUserProperties(); | |
14 | }, []); | |
15 | } |
This custom hook sets user properties for Amplitude tracking. It's using the browser's language settings and the current timestamp for the last login date. Be aware that this will update the user properties on every mount of the component using this hook, which might not be the desired behavior for the 'lastLoginDate' property in all cases.
4 | "@amplitude/analytics-browser": "^2.3.8", | |
SDK setup is a time-consuming hassle for both user and the company.
It often takes a months with endless back-and-forth emails.
Using Catch is like sending a solution engineer on-site.
Seamless setup in minutes. Empower customers, amplify growth.
Users can chat and get pull request. It will reduces customer support workloads.
Just put a button on your docs. Then users can install your SDK in minutes.
Take your competitors’ users in a minute. AI is good at code transformation.
Quickly add local files to your project with a CLI command.
Connect to GitHub and select a repo to work on.
You can also connect your local code with CLI.
Catch drastically cut down our time.
I loved how it magically inserted codes in the right places on our app’s codebase by reusing our existing logic.Daehyun Yoon
Co-Founder of Standada
Code uploads are E2E encrypted, and protected by AES-256 CDC and RSA-4096 encryption.
Connect your local project using CLI with a secure connection, even if you are not using GitHub. Learn More
Codes are separately stored on a E2E-encrypted sandbox, and deleted after a session.