Skip to content

feat(shortlink): add Beluga short link rewrite for hosted campaigns#3231

Merged
waleedlatif1 merged 1 commit intostagingfrom
feat/shortlink
Feb 17, 2026
Merged

feat(shortlink): add Beluga short link rewrite for hosted campaigns#3231
waleedlatif1 merged 1 commit intostagingfrom
feat/shortlink

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Feb 17, 2026

Summary

  • Add /r/:shortCode rewrite to proxy short links to Beluga's tracking system (go.trybeluga.ai)
  • Only active when isHosted is true so it doesn't affect self-hosted/OSS deployments

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 17, 2026 6:05pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 17, 2026

Greptile Summary

Adds a Next.js rewrite rule to proxy /r/:shortCode requests to Beluga's tracking service at go.trybeluga.ai. The rewrite is conditionally enabled via the isHosted feature flag, ensuring it only applies to the hosted deployment (sim.ai / staging.sim.ai) and does not affect self-hosted or OSS installations.

  • Adds async rewrites() to next.config.ts with a single conditional rewrite rule
  • Uses the existing isHosted flag for gating, consistent with the pattern used in async redirects()
  • No existing /r/ routes or middleware conflicts detected

Confidence Score: 4/5

  • This PR is safe to merge — it's a small, well-guarded config addition with no impact on self-hosted deployments.
  • The change is minimal (12 lines), properly gated behind the isHosted feature flag, follows existing patterns in the config file, and introduces no route conflicts. Score is 4 rather than 5 because there are no automated tests covering this rewrite behavior.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/sim/next.config.ts Adds an async rewrites() function that proxies /r/:shortCode to https://go.trybeluga.ai/:shortCode when isHosted is true. No route conflicts found; pattern follows existing conventions in the config.

Sequence Diagram

sequenceDiagram
    participant User as User/Browser
    participant Next as Next.js (sim.ai)
    participant Beluga as go.trybeluga.ai

    User->>Next: GET /r/:shortCode
    alt isHosted = true
        Next->>Beluga: Proxy rewrite to https://go.trybeluga.ai/:shortCode
        Beluga-->>Next: Tracking redirect response
        Next-->>User: Proxied response
    else isHosted = false (self-hosted)
        Next-->>User: 404 (no rewrite applied)
    end
Loading

Last reviewed commit: 8a70d1d

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit ad0d0ed into staging Feb 17, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/shortlink branch February 17, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant