doublej-project-linking

Embeddable corner widget with path-based profile matching and Short.io URL shortening integration.

bun install

Features

Path-Based Profiles

Widget auto-detects the page URL and loads the matching profile. Define rules with domain + path patterns and specificity-based priority.

Management Dashboard

Create and manage widget profiles through a modern SaaS-style dashboard with a slide-over editor.

Smart Matching

Specificity algorithm ranks exact paths over single wildcards over recursive wildcards. Most specific rule always wins.

Zero-Config Embed

Single script tag with no attributes needed. Widget fetches its own config from the API based on the current page URL.

Static Deployment

Deploy to GitHub Pages or any static host. The widget falls back to a static manifest when no API is available.

Shadow DOM Isolation

Widget mounts in a closed shadow DOM to prevent style leakage. Works reliably on any host page without CSS conflicts.

Getting Started

1

Install dependencies

Clone the repository and install with Bun.

bun install
2

Start the dev server

Launch the management UI and widget API.

bun run dev
3

Create a profile

Open http://localhost:5173 and create a widget profile with your desired links, CTA text, and accent color.

4

Add matching rules

Define domain and path patterns to control where the profile appears. Use exact paths, single wildcards (*), or recursive wildcards (**).

5

Embed the widget

Add a single script tag to your site. The widget handles the rest.

<script src="https://your-host.com/widget.js"></script>

Static Deployment

Deploy the widget to any static host — no server required.

1

Build the static assets

Generate the manifest and widget bundle.

bun run build:static
2

Deploy the dist/ folder

Upload widget.js and widget-manifest.json to any static host (GitHub Pages, Netlify, Vercel, S3, etc.).

3

Embed on your site

The widget tries the API first and falls back to the static manifest automatically.

<script src="https://your-pages-site.github.io/widget.js"></script>

Quick Install

One-liner to clone, install, and set up the project.

bash <(curl -fsSL https://raw.githubusercontent.com/jurrejan/doublej-project-linking/main/install.sh)

Path Matching

The specificity algorithm ensures the most specific rule always wins.

/blog/featured Priority: 1200

Exact path match

/blog/* Priority: 110

Single-level wildcard

/blog/** Priority: 101

Multi-level wildcard

/** Priority: 1

Catch-all fallback

MIT License