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.

tags

Kiran K94413a529d49
diff --git a/apps/docs/mint.json b/apps/docs/mint.json
index d1c97e76d7..4b7fe8aca1 100644
--- a/apps/docs/mint.json
+++ b/apps/docs/mint.json
@@ -35,6 +35,10 @@
{
"name": "API Reference",
"url": "api-reference"
+ },
+ {
+ "name": "SDKs",
+ "url": "sdks"
}
],
"anchors": [
@@ -115,6 +119,19 @@
{
"group": "Metatags",
"pages": ["api-reference/endpoint/retrieve-metatags"]
+ },
+ {
+ "group": "SDKs",
+ "pages": ["sdks/overview"]
+ },
+ {
+ "group": "TypeScript",
+ "pages": [
+ {
+ "group": "Tags",
+ "pages": ["sdks/typescript/tags/create", "sdks/typescript/tags/list"]
+ }
+ ]
}
],
"api": {
diff --git a/apps/docs/sdks/overview.mdx b/apps/docs/sdks/overview.mdx
new file mode 100644
index 0000000000..dbcc1b1890
--- /dev/null
+++ b/apps/docs/sdks/overview.mdx
@@ -0,0 +1,16 @@
+---
+title: "Overview"
+"og:title": "Open-source libraries & SDKs for Dub.co API"
+description: "Open-source client libraries for the Dub.co API"
+---
+
+<CardGroup cols={2}>
+ <Card
+ title="TypeScript"
+ icon="github"
+ href="/sdks/typescript"
+ color="#333333"
+ >
+ TypeScript SDK for Dub.co API
+ </Card>
+</CardGroup>
diff --git a/apps/docs/sdks/typescript.mdx b/apps/docs/sdks/typescript.mdx
new file mode 100644
index 0000000000..1c0f45f8e8
--- /dev/null
+++ b/apps/docs/sdks/typescript.mdx
@@ -0,0 +1,5 @@
+---
+title: "TypeScript"
+"og:title": "Open-source libraries & SDKs for Dub.co API"
+description: "Open-source client libraries for the Dub.co API"
+---
\ No newline at end of file
diff --git a/apps/docs/sdks/typescript/links/create.mdx b/apps/docs/sdks/typescript/links/create.mdx
new file mode 100644
index 0000000000..c297742d41
--- /dev/null
+++ b/apps/docs/sdks/typescript/links/create.mdx
@@ -0,0 +1,5 @@
+---
+title: "Create"
+"og:title": "Open-source libraries & SDKs for Dub.co API"
+description: "Open-source client libraries for the Dub.co API"
+---
\ No newline at end of file
diff --git a/apps/docs/sdks/typescript/tags/create.mdx b/apps/docs/sdks/typescript/tags/create.mdx
new file mode 100644
index 0000000000..57f81fe3a7
--- /dev/null
+++ b/apps/docs/sdks/typescript/tags/create.mdx
@@ -0,0 +1,52 @@
+---
+title: "Create"
+"og:title": "Create a new tag - TypeScript SDK"
+description: "Create a new tag for the authenticated workspace."
+---
+
+## Arguments
+
+<ParamField body="tag" type="string" required>
+ The name of the tag to create.
+</ParamField>
+
+<ParamField body="color" type="string">
+ The color of the tag. If not provided, a random color will be used from the
+ list: `red`, `yellow`, `green`, `blue`, `purple`, `pink`, `brown`.
+</ParamField>
+
+## Response
+
+<ResponseField name="id" type="string" required>
+ The unique ID of the tag.
+</ResponseField>
+
+<ResponseField name="name" type="string" required>
+ The name of the tag.
+</ResponseField>
+
+<ResponseField name="color" type="string" required>
+ The color of the tag.
+</ResponseField>
+
+<RequestExample>
+
+```ts
+await dub.tags.create({
+ tag: "news",
+});
+```
+
+</RequestExample>
+
+<ResponseExample>
+
+```ts
+{
+ id: "clv3j1h7o00032u1ngo8luv84",
+ name: "news",
+ color: "blue"
+}
+```
+
+</ResponseExample>
\ No newline at end of file
diff --git a/apps/docs/sdks/typescript/tags/list.mdx b/apps/docs/sdks/typescript/tags/list.mdx
new file mode 100644
index 0000000000..bb199a0975
--- /dev/null
+++ b/apps/docs/sdks/typescript/tags/list.mdx
@@ -0,0 +1,46 @@
+---
+title: "List"
+"og:title": "Retrieve a list of tags - TypeScript SDK"
+description: "Retrieve a list of tags for the authenticated workspace."
+---
+
+## Response
+
+<ResponseField name="id" type="string" required>
+ The unique ID of the tag.
+</ResponseField>
+
+<ResponseField name="name" type="string" required>
+ The name of the tag.
+</ResponseField>
+
+<ResponseField name="color" type="string" required>
+ The color of the tag.
+</ResponseField>
+
+<RequestExample>
+
+```ts
+await dub.tags.list({});
+```
+
+</RequestExample>
+
+<ResponseExample>
+
+```ts
+[
+ {
+ id: "clv3j1h7o00032u1ngo8luv84",
+ name: "news",
+ color: "blue",
+ },
+ {
+ id: "cluibmjj5000975qol4hnx0t7",
+ name: "work",
+ color: "red",
+ },
+];
+```
+
+</ResponseExample>