Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

remove old SDK methods

Kiran K8948115dbff6
diff --git a/apps/docs/api-reference/endpoint/retrieve-analytics.mdx b/apps/docs/api-reference/endpoint/retrieve-analytics.mdx
index 198fcbd71e..9fea57e6a0 100644
--- a/apps/docs/api-reference/endpoint/retrieve-analytics.mdx
+++ b/apps/docs/api-reference/endpoint/retrieve-analytics.mdx
@@ -3,9 +3,3 @@ title: Retrieve analytics
og:title: "Retrieve analytics for a link, a domain, or the authenticated workspace. - API Reference"
openapi: get /analytics
---
-
-## Response
-
-<ResponseField name="response" type="string" required>
- A response field example
-</ResponseField>
diff --git a/apps/docs/mint.json b/apps/docs/mint.json
index 9ba52aab30..14bf25c264 100644
--- a/apps/docs/mint.json
+++ b/apps/docs/mint.json
@@ -156,23 +156,7 @@
},
{
"group": "Analytics",
- "pages": [
- {
- "group": "Clicks",
- "pages": [
- "sdks/typescript/analytics/clicks/count",
- "sdks/typescript/analytics/clicks/timeseries",
- "sdks/typescript/analytics/clicks/browsers",
- "sdks/typescript/analytics/clicks/cities",
- "sdks/typescript/analytics/clicks/countries",
- "sdks/typescript/analytics/clicks/devices",
- "sdks/typescript/analytics/clicks/os",
- "sdks/typescript/analytics/clicks/referers",
- "sdks/typescript/analytics/clicks/top-links",
- "sdks/typescript/analytics/clicks/top-urls"
- ]
- }
- ]
+ "pages": ["sdks/typescript/analytics/retrieve"]
},
{
"group": "Workspaces",
diff --git a/apps/docs/sdks/typescript/analytics/clicks/browsers.mdx b/apps/docs/sdks/typescript/analytics/clicks/browsers.mdx
deleted file mode 100644
index e206afe570..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/browsers.mdx
+++ /dev/null
@@ -1,47 +0,0 @@
----
-title: dub.analytics.clicks.browsers
-sidebarTitle: Browsers
-description: Retrieve the top browsers by number of clicks for a link, a domain, or the authenticated workspace.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-<ResponseField name="browser" type="string" required>
- The name of the browser
-</ResponseField>
-
-<ResponseField name="clicks" type="number" required>
- The number of clicks from this browser
-</ResponseField>
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.browsers({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-[
- { browser: "Chrome", clicks: 19 },
- { browser: "Safari", clicks: 12 },
-];
-```
-
-</ResponseExample>
diff --git a/apps/docs/sdks/typescript/analytics/clicks/cities.mdx b/apps/docs/sdks/typescript/analytics/clicks/cities.mdx
deleted file mode 100644
index aab6dd8ddb..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/cities.mdx
+++ /dev/null
@@ -1,51 +0,0 @@
----
-title: dub.analytics.clicks.cities
-sidebarTitle: Cities
-description: Retrieve the top cities by number of clicks for a link, a domain, or the authenticated workspace.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-<ResponseField name="city" type="string" required>
- The name of the city
-</ResponseField>
-
-<ResponseField name="country" type="string" required>
- The 2-letter country code: [https://d.to/geo](https://d.to/geo)
-</ResponseField>
-
-<ResponseField name="clicks" type="number" required>
- The number of clicks from this city
-</ResponseField>
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.cities({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-[
- { city: "San Francisco", country: "US", clicks: 18 },
- { city: "Lviv", country: "UA", clicks: 1 },
-];
-```
-
-</ResponseExample>
diff --git a/apps/docs/sdks/typescript/analytics/clicks/count.mdx b/apps/docs/sdks/typescript/analytics/clicks/count.mdx
deleted file mode 100644
index 0d3b1fd22b..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/count.mdx
+++ /dev/null
@@ -1,38 +0,0 @@
----
-title: dub.analytics.clicks.count
-sidebarTitle: Count
-description: Retrieve total clicks count for a link, a domain, or the authenticated workspace.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-The number of clicks matching the specified queries.
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.count({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-20;
-```
-
-</ResponseExample>
diff --git a/apps/docs/sdks/typescript/analytics/clicks/countries.mdx b/apps/docs/sdks/typescript/analytics/clicks/countries.mdx
deleted file mode 100644
index 21137eae01..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/countries.mdx
+++ /dev/null
@@ -1,47 +0,0 @@
----
-title: dub.analytics.clicks.countries
-sidebarTitle: Countries
-description: Retrieve the top countries by number of clicks for a link, a domain, or the authenticated workspace.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-<ResponseField name="country" type="string" required>
- The 2-letter country code: [https://d.to/geo](https://d.to/geo)
-</ResponseField>
-
-<ResponseField name="clicks" type="number" required>
- The number of clicks from this country
-</ResponseField>
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.countries({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-[
- { country: "US", clicks: 18 },
- { country: "UA", clicks: 1 },
-];
-```
-
-</ResponseExample>
diff --git a/apps/docs/sdks/typescript/analytics/clicks/devices.mdx b/apps/docs/sdks/typescript/analytics/clicks/devices.mdx
deleted file mode 100644
index a074e1d7e8..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/devices.mdx
+++ /dev/null
@@ -1,47 +0,0 @@
----
-title: dub.analytics.clicks.devices
-sidebarTitle: Devices
-description: Retrieve the top devices by number of clicks for a link, a domain, or the authenticated workspace.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-<ResponseField name="device" type="string" required>
- The name of the device
-</ResponseField>
-
-<ResponseField name="clicks" type="number" required>
- The number of clicks from this device
-</ResponseField>
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.devices({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-[
- { device: "Desktop", clicks: 15 },
- { device: "Mobile", clicks: 12 },
-];
-```
-
-</ResponseExample>
diff --git a/apps/docs/sdks/typescript/analytics/clicks/os.mdx b/apps/docs/sdks/typescript/analytics/clicks/os.mdx
deleted file mode 100644
index 483173351c..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/os.mdx
+++ /dev/null
@@ -1,47 +0,0 @@
----
-title: dub.analytics.clicks.os
-sidebarTitle: OS
-description: Retrieve the top OS by number of clicks for a link, a domain, or the authenticated workspace.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-<ResponseField name="os" type="string" required>
- The name of the OS
-</ResponseField>
-
-<ResponseField name="clicks" type="number" required>
- The number of clicks from this OS
-</ResponseField>
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.os({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-[
- { os: "Mac OS", clicks: 19 },
- { os: "Windows", clicks: 12 },
-];
-```
-
-</ResponseExample>
diff --git a/apps/docs/sdks/typescript/analytics/clicks/referers.mdx b/apps/docs/sdks/typescript/analytics/clicks/referers.mdx
deleted file mode 100644
index 479d58c432..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/referers.mdx
+++ /dev/null
@@ -1,47 +0,0 @@
----
-title: dub.analytics.clicks.referers
-sidebarTitle: Referers
-description: Retrieve the top referers by number of clicks for a link, a domain, or the authenticated workspace.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-<ResponseField name="referer" type="string" required>
- The name of the referer. If unknown, this will be `(direct)`
-</ResponseField>
-
-<ResponseField name="clicks" type="number" required>
- The number of clicks from this referer
-</ResponseField>
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.referers({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-[
- { referer: "(direct)", clicks: 14 },
- { referer: "t.co", clicks: 12 },
-];
-```
-
-</ResponseExample>
diff --git a/apps/docs/sdks/typescript/analytics/clicks/timeseries.mdx b/apps/docs/sdks/typescript/analytics/clicks/timeseries.mdx
deleted file mode 100644
index 813702a320..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/timeseries.mdx
+++ /dev/null
@@ -1,49 +0,0 @@
----
-title: dub.analytics.clicks.timeseries
-sidebarTitle: Timeseries
-description: Retrieve timeseries click analytics for a link, a domain, or the authenticated workspace.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-<ResponseField name="start" type="string" required>
- The starting timestamp of the interval
-</ResponseField>
-
-<ResponseField name="clicks" type="number" required>
- The number of clicks in the interval
-</ResponseField>
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.timeseries({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-[
- { start: "2024-03-20T00:00:00.000Z", clicks: 15 },
- { start: "2024-03-21T00:00:00.000Z", clicks: 20 },
- { start: "2024-03-22T00:00:00.000Z", clicks: 18 },
- { start: "2024-03-23T00:00:00.000Z", clicks: 14 },
-];
-```
-
-</ResponseExample>
diff --git a/apps/docs/sdks/typescript/analytics/clicks/top-links.mdx b/apps/docs/sdks/typescript/analytics/clicks/top-links.mdx
deleted file mode 100644
index f4ead9d848..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/top-links.mdx
+++ /dev/null
@@ -1,47 +0,0 @@
----
-title: dub.analytics.clicks.topLinks
-sidebarTitle: Top Links
-description: Retrieve the top links by number of clicks for a domain or the authenticated workspace.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-<ResponseField name="link" type="string" required>
- The unique ID of the short link
-</ResponseField>
-
-<ResponseField name="clicks" type="number" required>
- The number of clicks from this link
-</ResponseField>
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.topLinks({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-[
- { link: "cluvb4cwi0001sd593yfdl1sz", clicks: 19 },
- { link: "clri4mgix0001l608ru12tcfr", clicks: 8 },
-];
-```
-
-</ResponseExample>
diff --git a/apps/docs/sdks/typescript/analytics/clicks/top-urls.mdx b/apps/docs/sdks/typescript/analytics/clicks/top-urls.mdx
deleted file mode 100644
index 2d2fbe1351..0000000000
--- a/apps/docs/sdks/typescript/analytics/clicks/top-urls.mdx
+++ /dev/null
@@ -1,47 +0,0 @@
----
-title: dub.analytics.clicks.topUrls
-sidebarTitle: Top URLs
-description: Retrieve the top URLs by number of clicks for a given short link.
----
-
-import AnalyticsArguments from "/snippets/analytics-arguments.mdx";
-
-<Note>
- Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
- higher.
-</Note>
-
-<AnalyticsArguments />
-
-## Response
-
-<ResponseField name="url" type="string" required>
- The destination URL
-</ResponseField>
-
-<ResponseField name="clicks" type="number" required>
- The number of clicks from this URL
-</ResponseField>
-
-<RequestExample>
-
-```typescript
-await dub.analytics.clicks.topUrls({
- key: "dummy",
- domain: "dub.sh",
- interval: "30d",
-});
-```
-
-</RequestExample>
-
-<ResponseExample>
-
-```typescript
-[
- { url: "https://dub.co/", clicks: 13 },
- { url: "https://dub.co/?qr=", clicks: 4 },
-];
-```
-
-</ResponseExample>