1. Seed Brand URLs

Purpose: Generate and seed deterministic tracking URLs for brands in the Brand Library using platform-aware URL discovery and category-aware priority scoring.

Prerequisites:

  • .env.local with SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY
  • Brands exist in the brands table

Cost / Duration: $0 | 10-30 min

Prompt

Seed brand URLs into the database.

Step 1 — Dry-run all brands (preview without writing):

```bash
bun scripts/seed-brand-urls.ts
```

Step 2 — Seed a single brand by canonical domain:

```bash
bun scripts/seed-brand-urls.ts --brand=slack.com --execute
```

Step 3 — Seed all brands:

```bash
bun scripts/seed-brand-urls.ts --execute
```

Processes up to 5 brands concurrently with 300ms rate limiting.

Step 4 — Filter by platform (Shopify, WooCommerce, etc.):

```bash
bun scripts/seed-brand-urls.ts --platform=shopify --execute
```

Step 5 — Quick mode (skip sitemap parsing, pattern-based only):

```bash
bun scripts/seed-brand-urls.ts --quick --execute
```

Step 6 — View URL distribution statistics:

```bash
bun scripts/seed-brand-urls.ts --stats
```

Step 7 — Clean up all previously seeded URLs:

```bash
bun scripts/seed-brand-urls.ts --cleanup
```

After seeding, verify with `--stats` to confirm URL counts per brand,
platform distribution, and coverage percentages.

Verification

  • Dry-run completes without errors
  • --stats shows URL counts per brand and platform distribution
  • No root domain URLs seeded (violates "No TLD Seeding" invariant)
  • Coverage percentages are healthy across brands

Back to index