Skip to content

Commit a40eb18

Browse files
committed
basic setup
1 parent 2798b2b commit a40eb18

File tree

6 files changed

+102
-0
lines changed

6 files changed

+102
-0
lines changed

apps/web/public/content/dub.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Connect Dub to Tinybird
2+
3+
1. Open the Dub UI and go to the Settings > Webhooks page.
4+
5+
2. Select "Create Webhook".
6+
7+
3. In Tinybird, go to Tokens, and copy the `append` token.
8+
9+
4. Back in Dub, paste the Events API URL as your webhook URL. Use the query parameter `name=dub` and `token=<your token>`. For example:
10+
11+
```
12+
https://api.tinybird.co/v0/events?name=dub&token=TOKEN
13+
```
14+
15+
5. Select the checkboxes for the events you want to send to Tinybird, and select "Create webhook".
16+
17+
6. You're done. Dub will now push events to Tinybird via the [Events API](https://tinybird.co/docs/get-data-in/ingest-apis/events-api).
18+
19+
20+
## See also
21+
22+
* [Events API](https://tinybird.co/docs/get-data-in/ingest-apis/events-api).

apps/web/public/dub_favicon.png

851 Bytes
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"use client"
2+
3+
import { useQueryState } from 'nuqs'
4+
import { useEffect } from 'react'
5+
6+
export default function DubDashboard() {
7+
const [token] = useQueryState('token')
8+
9+
useEffect(() => {
10+
async function fetchMetrics() {
11+
if (!token) return
12+
13+
try {
14+
const [] = await Promise.all([
15+
])
16+
} catch (error) {
17+
console.error('Failed to fetch metrics:', error)
18+
}
19+
}
20+
21+
fetchMetrics()
22+
}, [token])
23+
24+
return (
25+
<div className="space-y-8">
26+
{/* Metrics Row */}
27+
<div className="grid gap-4 md:grid-cols-3">
28+
</div>
29+
30+
{/* Charts Grid */}
31+
<div className="grid gap-4 md:grid-cols-2">
32+
</div>
33+
</div>
34+
)
35+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use client';
2+
3+
import { useEffect, useState } from 'react';
4+
import { Markdown } from '@/components/markdown';
5+
import { getMarkdownContent } from '@/lib/markdown';
6+
7+
export default function DubReadme() {
8+
const [content, setContent] = useState('');
9+
10+
useEffect(() => {
11+
getMarkdownContent('dub').then(setContent);
12+
}, []);
13+
14+
return (
15+
<div className="container max-w-4xl mx-auto py-8">
16+
<Markdown content={content} />
17+
</div>
18+
);
19+
}

apps/web/src/lib/constants.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ export const TOOLS: Record<string, AppGridItem> = {
127127
icon: '👀',
128128
icon_url: '/sentry_favicon.ico'
129129
},
130+
// Links
131+
dub: {
132+
id: 'dub',
133+
ds: 'dub',
134+
name: 'dub',
135+
description: 'Link infrastructure',
136+
icon: '👀',
137+
icon_url: '/dub_favicon.png'
138+
},
130139
};
131140

132141
export const TOOL_IMPORTS = {
@@ -182,6 +191,10 @@ export const TOOL_IMPORTS = {
182191
Dashboard: dynamic(() => import('@/components/tools/pagerduty/dashboard')),
183192
Readme: dynamic(() => import('@/components/tools/pagerduty/readme')),
184193
},
194+
dub: {
195+
Dashboard: dynamic(() => import('@/components/tools/dub/dashboard')),
196+
Readme: dynamic(() => import('@/components/tools/dub/readme')),
197+
},
185198
} as const;
186199

187200
export type ToolId = keyof typeof TOOL_IMPORTS;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
TOKEN "append" APPEND
2+
TOKEN "read" READ
3+
4+
TAGS "dub"
5+
6+
SCHEMA >
7+
`event_time` DateTime64(3) `json:$.tinybirdIngestTime` DEFAULT now(),
8+
`event_type` String `json:$.type` DEFAULT 'unknown',
9+
`event` JSON `json:$` DEFAULT '{}'
10+
11+
ENGINE "MergeTree"
12+
ENGINE_PARTITION_KEY "toYYYYMM(event_time)"
13+
ENGINE_SORTING_KEY "event_time"

0 commit comments

Comments
 (0)