Skip to content

Commit 6842ddb

Browse files
authored
docs: send md event instantly (#14744)
1 parent a6695dc commit 6842ddb

6 files changed

Lines changed: 60 additions & 24 deletions

File tree

  • www/apps
    • bloom/app/md-content/[[...slug]]
    • book/app/md-content/[[...slug]]
    • cloud/app/md-content/[[...slug]]
    • resources/app/md-content/[[...slug]]
    • ui/app/md-content/[[...slug]]
    • user-guide/app/md-content/[[...slug]]

www/apps/bloom/app/md-content/[[...slug]]/route.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,16 @@ export async function GET(req: NextRequest, { params }: Params) {
7777
defaults: "2025-05-24",
7878
})
7979

80-
posthog.capture("md_content_requested_agents", {
81-
path: req.url,
82-
user_agent: req.headers.get("user-agent") || undefined,
83-
})
80+
posthog.capture(
81+
"md_content_requested_agents",
82+
{
83+
path: req.url,
84+
user_agent: req.headers.get("user-agent") || undefined,
85+
},
86+
{
87+
send_instantly: true,
88+
}
89+
)
8490
}
8591

8692
return new NextResponse(cleanMdContent, {

www/apps/book/app/md-content/[[...slug]]/route.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,16 @@ export async function GET(req: NextRequest, { params }: Params) {
8484
defaults: "2025-05-24",
8585
})
8686

87-
posthog.capture("md_content_requested_agents", {
88-
path: req.url,
89-
user_agent: req.headers.get("user-agent") || undefined,
90-
})
87+
posthog.capture(
88+
"md_content_requested_agents",
89+
{
90+
path: req.url,
91+
user_agent: req.headers.get("user-agent") || undefined,
92+
},
93+
{
94+
send_instantly: true,
95+
}
96+
)
9197
}
9298

9399
return new NextResponse(cleanMdContent, {

www/apps/cloud/app/md-content/[[...slug]]/route.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,16 @@ export async function GET(req: NextRequest, { params }: Params) {
7474
defaults: "2025-05-24",
7575
})
7676

77-
posthog.capture("md_content_requested_agents", {
78-
path: req.url,
79-
user_agent: req.headers.get("user-agent") || undefined,
80-
})
77+
posthog.capture(
78+
"md_content_requested_agents",
79+
{
80+
path: req.url,
81+
user_agent: req.headers.get("user-agent") || undefined,
82+
},
83+
{
84+
send_instantly: true,
85+
}
86+
)
8187
}
8288

8389
return new NextResponse(cleanMdContent, {

www/apps/resources/app/md-content/[[...slug]]/route.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,16 @@ export async function GET(req: NextRequest, { params }: Params) {
8282
defaults: "2025-05-24",
8383
})
8484

85-
posthog.capture("md_content_requested_agents", {
86-
path: req.url,
87-
user_agent: req.headers.get("user-agent") || undefined,
88-
})
85+
posthog.capture(
86+
"md_content_requested_agents",
87+
{
88+
path: req.url,
89+
user_agent: req.headers.get("user-agent") || undefined,
90+
},
91+
{
92+
send_instantly: true,
93+
}
94+
)
8995
}
9096

9197
return new NextResponse(cleanMdContent, {

www/apps/ui/app/md-content/[[...slug]]/route.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,16 @@ export async function GET(req: NextRequest, { params }: Params) {
4949
defaults: "2025-05-24",
5050
})
5151

52-
posthog.capture("md_content_requested_agents", {
53-
path: req.url,
54-
user_agent: req.headers.get("user-agent") || undefined,
55-
})
52+
posthog.capture(
53+
"md_content_requested_agents",
54+
{
55+
path: req.url,
56+
user_agent: req.headers.get("user-agent") || undefined,
57+
},
58+
{
59+
send_instantly: true,
60+
}
61+
)
5662
}
5763

5864
return new NextResponse(cleanMdContent, {

www/apps/user-guide/app/md-content/[[...slug]]/route.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,16 @@ export async function GET(req: NextRequest, { params }: Params) {
7171
defaults: "2025-05-24",
7272
})
7373

74-
posthog.capture("md_content_requested_agents", {
75-
path: req.url,
76-
user_agent: req.headers.get("user-agent") || undefined,
77-
})
74+
posthog.capture(
75+
"md_content_requested_agents",
76+
{
77+
path: req.url,
78+
user_agent: req.headers.get("user-agent") || undefined,
79+
},
80+
{
81+
send_instantly: true,
82+
}
83+
)
7884
}
7985

8086
return new NextResponse(cleanMdContent, {

0 commit comments

Comments
 (0)