This val shows how you can use the new dub.links.upsert method to shorten a URL using the Dub API without creating duplicate links in your workspace for the given URL.
dub.links.upsert
https://evilsteventey-dublinksupsert.web.val.run
https://esm.town/v/evilsteventey/dubLinksUpsert
<script type="module" src="https://esm.town/v/evilsteventey/dubLinksUpsert" />