diff --git a/.github/workflows/check-page-descriptions.yml b/.github/workflows/check-page-descriptions.yml new file mode 100644 index 00000000..d9ad8bfa --- /dev/null +++ b/.github/workflows/check-page-descriptions.yml @@ -0,0 +1,20 @@ +name: Check page descriptions + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: node scripts/check-page-descriptions.mjs diff --git a/docs.json b/docs.json index 3f71a77d..f53b5ab0 100644 --- a/docs.json +++ b/docs.json @@ -2,6 +2,18 @@ "$schema": "https://mintlify.com/docs.json", "theme": "aspen", "name": "Dub", + "description": "Dub is the link attribution platform for running partner programs, tracking conversions and creating short links. These docs cover conversion tracking, the Dub API and Partner API, SDKs, webhooks and postbacks, and the Help Center.", + "markdown": { + "instructions": [ + "Use Dub to run partner and affiliate programs (partners, commissions, payouts, bounties), to track clicks, leads and sales from links, and to create and manage short links with analytics.", + "Every page is available as Markdown: add `.md` to its URL, for example https://dub.co/docs/api-reference/introduction.md. Search these docs with the docs MCP server at https://dub.co/docs/mcp.", + "To act on a Dub workspace, use the Dub MCP server at https://mcp.dub.sh/mcp/dub-partners (https://dub.co/docs/mcp-server.md) or the Dub API at https://api.dub.co with a workspace API key (https://dub.co/docs/api-reference/authentication.md).", + "Partners who want their own commissions, payouts, customers and messages across programs use the Dub Partners MCP server at https://mcp.dub.co/p/mcp (https://dub.co/docs/partner-api-reference/mcp-server.md) or the Partner API.", + "OpenAPI specs: the Dub API at https://dub.co/openapi.json and the Partner API at https://dub.co/partner-openapi.json.", + "Test conversion tracking, commissions and payouts in test mode: a staging workspace with `dub_test_` API keys and `dub_pk_test_` publishable keys, never production keys (https://dub.co/docs/testing.md).", + "Ask the user before any request that creates, updates or deletes data, sends a message, or affects commissions or payouts." + ] + }, "colors": { "primary": "#155dfc", "light": "#155dfc", diff --git a/docs.mdx b/docs.mdx index 7f8ac7c9..ab756ee6 100644 --- a/docs.mdx +++ b/docs.mdx @@ -1,5 +1,7 @@ --- -title: Introduction +title: "Introduction to Dub" +sidebarTitle: "Introduction" +description: "Dub is a link attribution platform for running partner programs, tracking conversions and creating short links, with a REST API, SDKs and webhooks." "og:image": /images/docs-og.jpg --- diff --git a/docs/api-reference/authentication.mdx b/docs/api-reference/authentication.mdx index c065b615..c937f469 100644 --- a/docs/api-reference/authentication.mdx +++ b/docs/api-reference/authentication.mdx @@ -1,6 +1,7 @@ --- title: "API Authentication" sidebarTitle: "Authentication" +description: "Dub API requests from your server use a workspace API key, while client-side conversion tracking uses a publishable key that is safe to include in frontend code." --- ## Introduction diff --git a/docs/api-reference/errors.mdx b/docs/api-reference/errors.mdx index acc9c979..2ebc2aa3 100644 --- a/docs/api-reference/errors.mdx +++ b/docs/api-reference/errors.mdx @@ -1,5 +1,6 @@ --- -title: "Errors" +title: "Dub API errors" +sidebarTitle: "Errors" og:title: "Dub API – Errors" description: "Learn about the error codes the Dub API returns and how to fix them." --- diff --git a/docs/api-reference/introduction.mdx b/docs/api-reference/introduction.mdx index 7089868a..53810cc9 100644 --- a/docs/api-reference/introduction.mdx +++ b/docs/api-reference/introduction.mdx @@ -1,5 +1,6 @@ --- -title: "Introduction" +title: "Introduction to the Dub API" +sidebarTitle: "Introduction" description: "Learn how to use Dub's API to programmatically manage resources in your Dub workspace." og:title: "Dub API – Introduction" --- diff --git a/docs/concepts/analytics/device.mdx b/docs/concepts/analytics/device.mdx index 87df7cf3..83dc908e 100644 --- a/docs/concepts/analytics/device.mdx +++ b/docs/concepts/analytics/device.mdx @@ -1,5 +1,6 @@ --- title: Device data +description: "Group link analytics by device type, browser or operating system with the `groupBy` parameter of the Analytics API." og:title: "Dub Analytics API – Aggregating analytics by device" --- diff --git a/docs/concepts/analytics/introduction.mdx b/docs/concepts/analytics/introduction.mdx index cc33284a..a4521d6d 100644 --- a/docs/concepts/analytics/introduction.mdx +++ b/docs/concepts/analytics/introduction.mdx @@ -1,5 +1,6 @@ --- -title: Introduction +title: "Introduction to the Analytics API" +sidebarTitle: "Introduction" "og:title": "Dub Analytics API – Introduction" description: "Learn how to use Dub's Analytics API to build real-time analytics dashboards for your links." --- diff --git a/docs/concepts/analytics/location.mdx b/docs/concepts/analytics/location.mdx index 59bf60ae..62e36b78 100644 --- a/docs/concepts/analytics/location.mdx +++ b/docs/concepts/analytics/location.mdx @@ -1,5 +1,6 @@ --- title: Location data +description: "Group link analytics by country, region, city or continent with the `groupBy` parameter of the Analytics API." og:title: "Dub Analytics API – Aggregating analytics by location" --- diff --git a/docs/concepts/analytics/referrers.mdx b/docs/concepts/analytics/referrers.mdx index 5dadc5f6..c4314a7d 100644 --- a/docs/concepts/analytics/referrers.mdx +++ b/docs/concepts/analytics/referrers.mdx @@ -1,5 +1,6 @@ --- title: Referrers data +description: "Group link analytics by referrer domain or full referrer URL with the `groupBy` parameter of the Analytics API." og:title: "Dub Analytics API – Aggregating analytics by referrers" --- diff --git a/docs/concepts/analytics/utm.mdx b/docs/concepts/analytics/utm.mdx index e466f56e..e5335b1a 100644 --- a/docs/concepts/analytics/utm.mdx +++ b/docs/concepts/analytics/utm.mdx @@ -1,5 +1,6 @@ --- title: UTM data +description: "Group link analytics by UTM source, medium, campaign, term or content with the `groupBy` parameter of the Analytics API." og:title: "Dub Analytics API – Aggregating analytics by UTM" --- diff --git a/docs/concepts/links/introduction.mdx b/docs/concepts/links/introduction.mdx index 1ccef1e4..85e0bbb1 100644 --- a/docs/concepts/links/introduction.mdx +++ b/docs/concepts/links/introduction.mdx @@ -1,5 +1,6 @@ --- -title: Introduction +title: "Introduction to the Links API" +sidebarTitle: "Introduction" og:title: "Dub Links API – Introduction" description: "Learn how to use Dub to programmatically create, update, and delete links at scale." --- diff --git a/docs/integrations.mdx b/docs/integrations.mdx index 35966eee..99405de0 100644 --- a/docs/integrations.mdx +++ b/docs/integrations.mdx @@ -1,5 +1,6 @@ --- -title: "Introduction" +title: "Introduction to Dub integrations" +sidebarTitle: "Introduction" "og:title": "Dub Integrations: Connect Dub to tools and services" description: "Integrate Dub with your favorite tools and services." --- diff --git a/docs/partner-api-reference/commissions/list.mdx b/docs/partner-api-reference/commissions/list.mdx index 1b195870..3f81966b 100644 --- a/docs/partner-api-reference/commissions/list.mdx +++ b/docs/partner-api-reference/commissions/list.mdx @@ -1,5 +1,6 @@ --- openapi: https://dub.co/partner-openapi.json GET /commissions +title: "Partner API: List all commissions" sidebarTitle: "List commissions" --- diff --git a/docs/partner-api-reference/customers/list.mdx b/docs/partner-api-reference/customers/list.mdx index 897f0bd8..e08a8539 100644 --- a/docs/partner-api-reference/customers/list.mdx +++ b/docs/partner-api-reference/customers/list.mdx @@ -1,5 +1,6 @@ --- openapi: https://dub.co/partner-openapi.json GET /customers +title: "Partner API: List all customers" sidebarTitle: "List customers" --- diff --git a/docs/partner-api-reference/errors.mdx b/docs/partner-api-reference/errors.mdx index 76cca54f..6999733a 100644 --- a/docs/partner-api-reference/errors.mdx +++ b/docs/partner-api-reference/errors.mdx @@ -1,5 +1,6 @@ --- -title: "Errors" +title: "Partner API errors" +sidebarTitle: "Errors" og:title: "Dub Partner API – Errors" description: "Learn about the error codes the Dub Partner API returns and how to fix them." --- diff --git a/docs/partner-api-reference/introduction.mdx b/docs/partner-api-reference/introduction.mdx index 08924e24..b7be60f0 100644 --- a/docs/partner-api-reference/introduction.mdx +++ b/docs/partner-api-reference/introduction.mdx @@ -1,5 +1,6 @@ --- -title: Introduction +title: "Introduction to the Partner API" +sidebarTitle: "Introduction" description: "Learn how to use Dub's Partner API to access your commissions, payouts, referred customers and programs." og:title: Dub Partner API – Introduction --- diff --git a/docs/partner-api-reference/messages/list.mdx b/docs/partner-api-reference/messages/list.mdx index b1c641fe..2abbaacf 100644 --- a/docs/partner-api-reference/messages/list.mdx +++ b/docs/partner-api-reference/messages/list.mdx @@ -1,5 +1,6 @@ --- openapi: https://dub.co/partner-openapi.json GET /messages +title: "Partner API: List all messages" sidebarTitle: "List messages" --- diff --git a/docs/partner-api-reference/messages/send.mdx b/docs/partner-api-reference/messages/send.mdx index 55e63e3e..0f279930 100644 --- a/docs/partner-api-reference/messages/send.mdx +++ b/docs/partner-api-reference/messages/send.mdx @@ -1,5 +1,6 @@ --- openapi: https://dub.co/partner-openapi.json POST /messages +title: "Partner API: Send a message to a program" sidebarTitle: "Send a message" --- diff --git a/docs/partner-api-reference/payouts/list.mdx b/docs/partner-api-reference/payouts/list.mdx index 433cb234..53fa0e53 100644 --- a/docs/partner-api-reference/payouts/list.mdx +++ b/docs/partner-api-reference/payouts/list.mdx @@ -1,5 +1,6 @@ --- openapi: https://dub.co/partner-openapi.json GET /payouts +title: "Partner API: List all payouts" sidebarTitle: "List payouts" --- diff --git a/docs/partner-api-reference/programs/list-network.mdx b/docs/partner-api-reference/programs/list-network.mdx index e158bcd5..c94bdb88 100644 --- a/docs/partner-api-reference/programs/list-network.mdx +++ b/docs/partner-api-reference/programs/list-network.mdx @@ -1,5 +1,6 @@ --- openapi: https://dub.co/partner-openapi.json GET /programs/network +title: "Partner API: List all programs in the partner network" sidebarTitle: "List network programs" --- diff --git a/docs/partner-api-reference/programs/list.mdx b/docs/partner-api-reference/programs/list.mdx index ccf4caa8..2369e162 100644 --- a/docs/partner-api-reference/programs/list.mdx +++ b/docs/partner-api-reference/programs/list.mdx @@ -1,5 +1,6 @@ --- openapi: https://dub.co/partner-openapi.json GET /programs +title: "Partner API: List all programs" sidebarTitle: "List programs" --- diff --git a/docs/postbacks/event-types.mdx b/docs/postbacks/event-types.mdx index 965722e2..2abd5eb7 100644 --- a/docs/postbacks/event-types.mdx +++ b/docs/postbacks/event-types.mdx @@ -1,5 +1,6 @@ --- -title: Event types +title: "Postback event types" +sidebarTitle: "Event types" og:title: "Dub Postbacks – Event types" description: "List of supported postback event types and their payloads" --- diff --git a/docs/postbacks/events/commission-created.mdx b/docs/postbacks/events/commission-created.mdx index 9fb87b53..ce21fb7c 100644 --- a/docs/postbacks/events/commission-created.mdx +++ b/docs/postbacks/events/commission-created.mdx @@ -1,5 +1,7 @@ --- -title: commission.created +title: "commission.created postback" +sidebarTitle: "commission.created" +description: "Sent to your postback URL whenever a commission is created for you." icon: money-bill --- diff --git a/docs/postbacks/events/lead-created.mdx b/docs/postbacks/events/lead-created.mdx index 6d38eef2..f23b724b 100644 --- a/docs/postbacks/events/lead-created.mdx +++ b/docs/postbacks/events/lead-created.mdx @@ -1,5 +1,7 @@ --- -title: lead.created +title: "lead.created postback" +sidebarTitle: "lead.created" +description: "Sent to your postback URL whenever a lead is tracked through one of your referral links." icon: user-crown --- diff --git a/docs/postbacks/events/message-received.mdx b/docs/postbacks/events/message-received.mdx index 2a470056..a763334c 100644 --- a/docs/postbacks/events/message-received.mdx +++ b/docs/postbacks/events/message-received.mdx @@ -1,5 +1,7 @@ --- -title: message.received +title: "message.received postback" +sidebarTitle: "message.received" +description: "Sent to your postback URL whenever a program you're enrolled in sends you a direct message, but not for campaign messages." icon: message --- diff --git a/docs/postbacks/events/sale-created.mdx b/docs/postbacks/events/sale-created.mdx index 30cd29ab..c4b8042d 100644 --- a/docs/postbacks/events/sale-created.mdx +++ b/docs/postbacks/events/sale-created.mdx @@ -1,5 +1,7 @@ --- -title: sale.created +title: "sale.created postback" +sidebarTitle: "sale.created" +description: "Sent to your postback URL whenever a sale is tracked through one of your referral links." icon: coins --- diff --git a/docs/postbacks/introduction.mdx b/docs/postbacks/introduction.mdx index c85d7edc..fe0fbc33 100644 --- a/docs/postbacks/introduction.mdx +++ b/docs/postbacks/introduction.mdx @@ -1,5 +1,6 @@ --- -title: Introduction +title: "Introduction to postbacks" +sidebarTitle: "Introduction" og:title: Dub Postbacks – Introduction description: "Use postbacks to get real-time notifications on events happening across your Dub partner account." --- diff --git a/docs/sdks/client-side-mobile/introduction.mdx b/docs/sdks/client-side-mobile/introduction.mdx index 6e6c8638..8a4b2dac 100644 --- a/docs/sdks/client-side-mobile/introduction.mdx +++ b/docs/sdks/client-side-mobile/introduction.mdx @@ -1,5 +1,6 @@ --- -title: Introduction +title: "Introduction to the Dub mobile SDKs" +sidebarTitle: "Introduction" description: Learn more about the Dub client-side mobile SDKs. --- diff --git a/docs/sdks/client-side/features/click-tracking.mdx b/docs/sdks/client-side/features/click-tracking.mdx index e5f74fe9..b294902c 100644 --- a/docs/sdks/client-side/features/click-tracking.mdx +++ b/docs/sdks/client-side/features/click-tracking.mdx @@ -1,5 +1,6 @@ --- title: Client-side click tracking +description: "The Dub Analytics script tracks clicks from query parameters such as `?via=john` on your own domain, or from a `trackClick()` call in your code, without a short link." --- import ClickIdSpoofingPreventionTip from "/snippets/click-id-spoofing-prevention-tip.mdx"; diff --git a/docs/sdks/client-side/features/conversion-tracking.mdx b/docs/sdks/client-side/features/conversion-tracking.mdx index e9e53cf2..00aa9c85 100644 --- a/docs/sdks/client-side/features/conversion-tracking.mdx +++ b/docs/sdks/client-side/features/conversion-tracking.mdx @@ -1,5 +1,6 @@ --- title: Client-side conversion tracking +description: "Track lead and sale events from the browser with the Dub Analytics script when you don't have access to server-side code." --- import ClientSideTrackingWarning from "/snippets/client-side-tracking-warning.mdx"; diff --git a/docs/sdks/client-side/features/cross-domain-tracking.mdx b/docs/sdks/client-side/features/cross-domain-tracking.mdx index d1bb06e7..465ab8ef 100644 --- a/docs/sdks/client-side/features/cross-domain-tracking.mdx +++ b/docs/sdks/client-side/features/cross-domain-tracking.mdx @@ -1,5 +1,6 @@ --- title: Cross-domain tracking +description: "The Dub Analytics script shares the `dub_id` cookie across subdomains with cookie options, and across separate domains by appending it to outbound links." --- By default, the script already sets the `dub_id` cookie on a **cross-domain level**. diff --git a/docs/sdks/client-side/features/identity-tracking.mdx b/docs/sdks/client-side/features/identity-tracking.mdx index 8e34564e..1be8d4de 100644 --- a/docs/sdks/client-side/features/identity-tracking.mdx +++ b/docs/sdks/client-side/features/identity-tracking.mdx @@ -1,6 +1,7 @@ --- title: Identity tracking for partner risk monitoring sidebarTitle: Identity tracking +description: "The identity variant of the Dub Analytics script links a visitor's device to their partner click on the paths you choose, so risk monitoring can flag fraud and abuse." tag: "Beta" --- diff --git a/docs/sdks/client-side/features/reverse-proxy-support.mdx b/docs/sdks/client-side/features/reverse-proxy-support.mdx index 81db4a2d..ecf13180 100644 --- a/docs/sdks/client-side/features/reverse-proxy-support.mdx +++ b/docs/sdks/client-side/features/reverse-proxy-support.mdx @@ -1,5 +1,6 @@ --- title: Reverse-proxy support +description: "Serve the Dub Analytics script and its tracking requests from your own domain through a reverse proxy, so ad blockers don't block them." --- To avoid ad-blockers from blocking the Dub Analytics script and its tracking requests, we recommend setting up a reverse proxy. diff --git a/docs/sdks/client-side/installation-guides/google-tag-manager.mdx b/docs/sdks/client-side/installation-guides/google-tag-manager.mdx index 1f6c5a0e..400dba0c 100644 --- a/docs/sdks/client-side/installation-guides/google-tag-manager.mdx +++ b/docs/sdks/client-side/installation-guides/google-tag-manager.mdx @@ -1,5 +1,6 @@ --- -title: Google Tag Manager +title: "Install the Dub Analytics script with Google Tag Manager" +sidebarTitle: "Google Tag Manager" description: How to add the Dub Analytics script to your site using Google Tag Manager og:image: https://assets.dub.co/cms/gtm-integration.jpeg --- diff --git a/docs/sdks/client-side/installation-guides/shopify.mdx b/docs/sdks/client-side/installation-guides/shopify.mdx index 56b88bab..77ae2e6e 100644 --- a/docs/sdks/client-side/installation-guides/shopify.mdx +++ b/docs/sdks/client-side/installation-guides/shopify.mdx @@ -1,5 +1,6 @@ --- -title: Shopify +title: "Install the Dub Analytics script on Shopify" +sidebarTitle: "Shopify" description: How to add the Dub Analytics script to your Shopify store --- diff --git a/docs/sdks/client-side/introduction.mdx b/docs/sdks/client-side/introduction.mdx index 9abe99ce..66113ccc 100644 --- a/docs/sdks/client-side/introduction.mdx +++ b/docs/sdks/client-side/introduction.mdx @@ -1,5 +1,6 @@ --- -title: Introduction +title: "Introduction to the Dub Analytics script" +sidebarTitle: "Introduction" description: Learn more about the Dub Analytics script and how to install it. --- diff --git a/docs/webhooks/event-types.mdx b/docs/webhooks/event-types.mdx index 881f9669..34ed2fea 100644 --- a/docs/webhooks/event-types.mdx +++ b/docs/webhooks/event-types.mdx @@ -1,5 +1,6 @@ --- -title: Event types +title: "Webhook event types" +sidebarTitle: "Event types" og:title: "Dub Webhooks – Event types" description: "List of supported webhook event types and their payloads" --- diff --git a/docs/webhooks/events/bounty-created.mdx b/docs/webhooks/events/bounty-created.mdx index d4bb4281..264dcf87 100644 --- a/docs/webhooks/events/bounty-created.mdx +++ b/docs/webhooks/events/bounty-created.mdx @@ -1,5 +1,6 @@ --- title: bounty.created +description: "Sent whenever a bounty is created in your program." icon: trophy --- diff --git a/docs/webhooks/events/bounty-updated.mdx b/docs/webhooks/events/bounty-updated.mdx index 8b2de680..86d0b754 100644 --- a/docs/webhooks/events/bounty-updated.mdx +++ b/docs/webhooks/events/bounty-updated.mdx @@ -1,5 +1,6 @@ --- title: bounty.updated +description: "Sent with the bounty's full, updated state whenever a bounty in your program is updated, but not when one is deleted." icon: trophy --- diff --git a/docs/webhooks/events/commission-created.mdx b/docs/webhooks/events/commission-created.mdx index df850401..1295c38e 100644 --- a/docs/webhooks/events/commission-created.mdx +++ b/docs/webhooks/events/commission-created.mdx @@ -1,5 +1,6 @@ --- title: commission.created +description: "Sent whenever a commission is created for a partner, from a tracked conversion or manually in the dashboard, including clawbacks with a negative amount." icon: money-bill --- diff --git a/docs/webhooks/events/discount-code-created.mdx b/docs/webhooks/events/discount-code-created.mdx index 553185d6..74b2eedd 100644 --- a/docs/webhooks/events/discount-code-created.mdx +++ b/docs/webhooks/events/discount-code-created.mdx @@ -1,5 +1,6 @@ --- title: discount_code.created +description: "Sent whenever a discount code is created for a partner, through the API, the dashboard or auto-provisioning when a partner joins a group." icon: ticket --- diff --git a/docs/webhooks/events/discount-code-deleted.mdx b/docs/webhooks/events/discount-code-deleted.mdx index 9bff0a42..b5aa85da 100644 --- a/docs/webhooks/events/discount-code-deleted.mdx +++ b/docs/webhooks/events/discount-code-deleted.mdx @@ -1,5 +1,6 @@ --- title: discount_code.deleted +description: "Sent whenever a partner's discount code is deleted, including automatic removals when a partner is banned, deactivated or moved to a group without an equivalent discount." icon: ticket --- diff --git a/docs/webhooks/events/lead-created.mdx b/docs/webhooks/events/lead-created.mdx index 7d7de97d..414fa1b5 100644 --- a/docs/webhooks/events/lead-created.mdx +++ b/docs/webhooks/events/lead-created.mdx @@ -1,5 +1,6 @@ --- title: lead.created +description: "Sent whenever a lead event is tracked." icon: user-crown --- diff --git a/docs/webhooks/events/link-clicked.mdx b/docs/webhooks/events/link-clicked.mdx index f3c751ff..d8700481 100644 --- a/docs/webhooks/events/link-clicked.mdx +++ b/docs/webhooks/events/link-clicked.mdx @@ -1,5 +1,6 @@ --- title: link.clicked +description: "Sent whenever a link is clicked or its QR code is scanned, for all links, links in selected folders or selected links." icon: link --- diff --git a/docs/webhooks/events/link-created.mdx b/docs/webhooks/events/link-created.mdx index 9703fe9a..9ae21f17 100644 --- a/docs/webhooks/events/link-created.mdx +++ b/docs/webhooks/events/link-created.mdx @@ -1,5 +1,6 @@ --- title: link.created +description: "Sent whenever a link is created in your workspace." icon: link --- diff --git a/docs/webhooks/events/link-deleted.mdx b/docs/webhooks/events/link-deleted.mdx index 3834873a..4dc88b2f 100644 --- a/docs/webhooks/events/link-deleted.mdx +++ b/docs/webhooks/events/link-deleted.mdx @@ -1,5 +1,6 @@ --- title: link.deleted +description: "Sent whenever a link in your workspace is deleted." icon: link --- diff --git a/docs/webhooks/events/link-updated.mdx b/docs/webhooks/events/link-updated.mdx index 87ab9230..01f6fb03 100644 --- a/docs/webhooks/events/link-updated.mdx +++ b/docs/webhooks/events/link-updated.mdx @@ -1,5 +1,6 @@ --- title: link.updated +description: "Sent whenever a link in your workspace is updated." icon: link --- diff --git a/docs/webhooks/events/message-received.mdx b/docs/webhooks/events/message-received.mdx index 2afdee6a..20abe874 100644 --- a/docs/webhooks/events/message-received.mdx +++ b/docs/webhooks/events/message-received.mdx @@ -1,5 +1,6 @@ --- title: message.received +description: "Sent whenever a partner sends a message to your program, but not for messages your program sends." icon: message --- diff --git a/docs/webhooks/events/partner-enrolled.mdx b/docs/webhooks/events/partner-enrolled.mdx index 68f69eb2..adf35d4d 100644 --- a/docs/webhooks/events/partner-enrolled.mdx +++ b/docs/webhooks/events/partner-enrolled.mdx @@ -1,5 +1,6 @@ --- title: partner.enrolled +description: "Sent whenever a partner is enrolled in your program, through an approved application, an accepted invite or the API." icon: users --- diff --git a/docs/webhooks/events/partner-merged.mdx b/docs/webhooks/events/partner-merged.mdx index d489a2ea..c4e3bfc3 100644 --- a/docs/webhooks/events/partner-merged.mdx +++ b/docs/webhooks/events/partner-merged.mdx @@ -1,5 +1,6 @@ --- title: partner.merged +description: "Sent when two partner accounts are merged, with the source partner collapsed into the target partner." icon: users --- diff --git a/docs/webhooks/events/program-application-created.mdx b/docs/webhooks/events/program-application-created.mdx index 915f1776..f9e4391d 100644 --- a/docs/webhooks/events/program-application-created.mdx +++ b/docs/webhooks/events/program-application-created.mdx @@ -1,5 +1,6 @@ --- title: program_application.created +description: "Sent whenever a partner submits an application to your program." icon: users --- diff --git a/docs/webhooks/events/sale-created.mdx b/docs/webhooks/events/sale-created.mdx index 7e513a10..a79841fb 100644 --- a/docs/webhooks/events/sale-created.mdx +++ b/docs/webhooks/events/sale-created.mdx @@ -1,5 +1,6 @@ --- title: sale.created +description: "Sent whenever a sale event is tracked." icon: coins --- diff --git a/docs/webhooks/introduction.mdx b/docs/webhooks/introduction.mdx index 7ea5b66b..e7cacfd6 100644 --- a/docs/webhooks/introduction.mdx +++ b/docs/webhooks/introduction.mdx @@ -1,5 +1,6 @@ --- -title: Introduction +title: "Introduction to webhooks" +sidebarTitle: "Introduction" og:title: Dub Webhooks – Introduction description: "Use webhooks to get real-time notifications on events happening across your Dub workspace." --- diff --git a/scripts/check-page-descriptions.mjs b/scripts/check-page-descriptions.mjs new file mode 100644 index 00000000..3d8ae0da --- /dev/null +++ b/scripts/check-page-descriptions.mjs @@ -0,0 +1,102 @@ +import { existsSync, readFileSync } from "node:fs"; + +const NAVIGATION_KEYS = [ + "tabs", + "anchors", + "dropdowns", + "versions", + "languages", + "products", + "groups", + "pages", +]; + +function collectPages(node, pages) { + if (typeof node === "string") { + pages.push(node); + return; + } + + if (Array.isArray(node)) { + for (const child of node) { + collectPages(child, pages); + } + return; + } + + if (!node || typeof node !== "object") { + return; + } + + for (const key of NAVIGATION_KEYS) { + if (key in node) { + collectPages(node[key], pages); + } + } +} + +function findPageFile(page) { + return [`${page}.mdx`, `${page}.md`].find((file) => existsSync(file)); +} + +function readFrontmatter(file) { + const match = readFileSync(file, "utf8").match(/^---\r?\n([\s\S]*?)\r?\n---/); + + if (!match) { + return {}; + } + + const fields = {}; + + for (const line of match[1].split(/\r?\n/)) { + const field = line.match(/^["']?([\w:-]+)["']?:\s*(.*)$/); + + if (field) { + fields[field[1]] = field[2] + .trim() + .replace(/^["']|["']$/g, "") + .trim(); + } + } + + return fields; +} + +const docsConfig = JSON.parse(readFileSync("docs.json", "utf8")); +const pages = []; +collectPages(docsConfig.navigation, pages); + +const problems = []; + +for (const page of new Set(pages)) { + const file = findPageFile(page); + + if (!file) { + problems.push(`${page}: no .mdx or .md file found`); + continue; + } + + const frontmatter = readFrontmatter(file); + + if (frontmatter.openapi || frontmatter.api) { + continue; + } + + if (!frontmatter.description) { + problems.push(`${file}: missing frontmatter description`); + } +} + +if (problems.length > 0) { + console.error( + `${problems.length} page(s) in the docs.json navigation need a frontmatter description, which Mintlify uses in llms.txt:\n`, + ); + + for (const problem of problems) { + console.error(`- ${problem}`); + } + + process.exit(1); +} + +console.log("Every page in the docs.json navigation has a description.");