# Social Previews

In LinkSense — a dynamic link management platform — every dynamic link can carry custom social preview metadata. When a social-media crawler (Slack, Discord, Twitter/X, Facebook, LinkedIn, WhatsApp, Telegram, Pinterest, etc.) fetches a LinkSense URL, the platform serves an HTML page with Open Graph and Twitter Card tags instead of redirecting. Real users still get redirected normally to the right destination for their device.

## Configure a preview

When creating or editing a dynamic link you can set:

- `social_title` — headline shown in the preview card.
- `social_description` — short blurb under the title.
- `social_image_url` — image displayed in the preview card.

For best results set all three. Missing fields cause platforms to fall back to generic metadata or show no preview at all.

## Open Graph tags emitted

When a crawler hits the link, LinkSense generates:

| Tag | Source |
|---|---|
| `og:title` | `social_title` |
| `og:description` | `social_description` |
| `og:image` | `social_image_url` |
| `og:url` | the canonical URL of your dynamic link |
| `twitter:card` | `summary_large_image` (when an image is provided) |
| `twitter:title` | `social_title` |
| `twitter:description` | `social_description` |
| `twitter:image` | `social_image_url` |

## Bot detection

LinkSense detects social-media crawlers via User-Agent and serves them HTML with the meta tags above. Regular users hit the device-routing logic instead. No special configuration is needed — bot detection is automatic.

## Image guidelines

- **Recommended size**: 1200 × 630 pixels.
- **Aspect ratio**: 1.91:1.
- **Format**: JPEG or PNG.
- **File size**: under 5 MB (smaller is faster).
- **Composition**: keep important content centered — platforms may crop edges.
- **URL**: must be a publicly accessible HTTPS URL. Platforms won't load HTTP or authenticated images.

## Test previews

Use platform-specific tools to verify how a card will render:

- **Facebook**: Sharing Debugger at developers.facebook.com.
- **Twitter/X**: Card Validator at cards-dev.twitter.com.
- **LinkedIn**: Post Inspector at linkedin.com/post-inspector.

Social platforms aggressively cache preview data. If you update settings and the old preview keeps showing, use the platform's debugger to clear the cache and re-fetch.
