mirror of
https://github.com/LukeHagar/dub-node.git
synced 2025-12-06 04:19:37 +00:00
966 lines
25 KiB
YAML
966 lines
25 KiB
YAML
overlay: 1.0.0
|
|
info:
|
|
title: CodeSamples overlay for typescript target
|
|
version: 0.0.0
|
|
actions:
|
|
- target: $["paths"]["/links/{linkId}"]["delete"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "deleteLink"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.links.delete("<value>");
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/devices"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getDevicesByClicks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.devices({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/workspaces"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getWorkspaces"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.workspaces.list();
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/domains/{slug}/transfer"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "transferDomain"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.domains.transfer("acme.com", {
|
|
newWorkspaceId: "<value>",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/links/{linkId}"]["patch"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "updateLink"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.links.update("<value>", {
|
|
url: "https://google/com",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/os"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getOSByClicksDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.os({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/top_links"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getTopLinksByClicksDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.topLinks({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/cities"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getCitiesByClicks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.cities({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/qr"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getQRCode"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.qrCodes.get({
|
|
url: "https://brief-micronutrient.org",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/browsers"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getBrowsersByClicks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.browsers({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/workspaces/{idOrSlug}"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getWorkspace"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.workspaces.get({
|
|
idOrSlug: "<value>",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/links/info"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getLinkInfo"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.links.get({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/timeseries"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getTimeseriesByClicksDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.timeseries({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/top_urls"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getTopURLsByClicksDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.topUrls({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getClicksCountDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.getClicksCountDeprecated({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/workspaces"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "createWorkspace"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.workspaces.create({
|
|
name: "<value>",
|
|
slug: "<value>",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/domains/{slug}/primary"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "setPrimaryDomain"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.domains.setPrimary("acme.com");
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/track/sale"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "trackSale"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
import { PaymentProcessor } from "dub/models/operations";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.track.sale({
|
|
customerId: "<value>",
|
|
amount: 996500,
|
|
paymentProcessor: PaymentProcessor.Shopify,
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/links"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "createLink"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.links.create({
|
|
url: "https://google/com",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/links/count"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getLinksCount"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.links.count({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/device"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getDevicesByClicksDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.device({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/tags"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getTags"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.tags.list({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/track/lead"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "trackLead"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.track.lead({
|
|
clickId: "<value>",
|
|
eventName: "Signup",
|
|
customerId: "<value>",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/metatags"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getMetatags"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.metatags.get({
|
|
url: "https://dub.co",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/city"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getCitiesByClicksDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.city({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/referers"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getReferersByClicks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.referers({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/domains/{slug}"]["delete"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "deleteDomain"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.domains.delete("acme.com");
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/track/customer"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "trackCustomer"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.track.customer({
|
|
customerId: "<value>",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/domains"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "addDomain"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.domains.add({
|
|
slug: "acme.com",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/links/bulk"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "bulkCreateLinks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.links.createMany([
|
|
{
|
|
url: "https://google/com",
|
|
},
|
|
]);
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/country"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getCountriesByClicksDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.country({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/browser"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getBrowsersByClicksDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.browser({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/referer"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getReferersByClicksDeprecated"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.referer({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/count"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getClicksCount"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.count({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/tags"]["post"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "createTag"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.tags.create({
|
|
tag: "<value>",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/domains"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "listDomains"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.domains.list({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/domains/{slug}"]["patch"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "updateDomain"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.domains.update("acme.com", {});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/links/upsert"]["put"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "upsertLink"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.links.upsert({
|
|
url: "https://google/com",
|
|
});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/links"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getLinks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.links.list({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/timeseries"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getTimeseriesByClicks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.timeseries({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/countries"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getCountriesByClicks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.countries({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/os"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getOSByClicks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.os({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/top_links"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getTopLinksByClicks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.topLinks({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/analytics/clicks/top_urls"]["get"]
|
|
update:
|
|
"x-codeSamples":
|
|
- "lang": "typescript"
|
|
"label": "getTopURLsByClicks"
|
|
"source": |-
|
|
import { Dub } from "dub";
|
|
|
|
const dub = new Dub({
|
|
token: "DUB_API_KEY",
|
|
workspaceId: "<value>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dub.analytics.clicks.topUrls({});
|
|
|
|
// Handle the result
|
|
console.log(result)
|
|
}
|
|
|
|
run();
|