VeeFriends.LinkShortener
5.0.13
See the version list below for details.
dotnet add package VeeFriends.LinkShortener --version 5.0.13
NuGet\Install-Package VeeFriends.LinkShortener -Version 5.0.13
<PackageReference Include="VeeFriends.LinkShortener" Version="5.0.13" />
<PackageVersion Include="VeeFriends.LinkShortener" Version="5.0.13" />
<PackageReference Include="VeeFriends.LinkShortener" />
paket add VeeFriends.LinkShortener --version 5.0.13
#r "nuget: VeeFriends.LinkShortener, 5.0.13"
#:package VeeFriends.LinkShortener@5.0.13
#addin nuget:?package=VeeFriends.LinkShortener&version=5.0.13
#tool nuget:?package=VeeFriends.LinkShortener&version=5.0.13
VeeFriends.LinkShortener 📎✨
VeeFriends.LinkShortener is a modern, production-ready .NET 9 library and service for creating, managing, and tracking short links. It features robust analytics, QR code generation, and seamless integration with Azure Table Storage, Cloudinary, and Link Preview APIs. Designed for extensibility and testability, it supports dependency injection and is fully covered by automated tests.
Features
- Short Link Creation: Generate branded, expiring, and analytics-enabled short URLs.
- Analytics Tracking: Collects and stores detailed analytics for each link visit, including IP, user agent, geo, and device info.
- QR Code Generation: Automatically generates QR codes for each short link.
- Link Preview Integration: Fetches and stores link preview metadata (title, description, image).
- Cloudinary Support: Stores and serves QR codes and images via Cloudinary.
- Azure Table Storage: Fast, scalable, and cost-effective storage for links and analytics.
- Extensible & Testable: Built for dependency injection and easy extension.
- .NET 9 & C# 13: Uses the latest .NET and C# features.
Installation
Install the VeeFriends.LinkShortener NuGet package in your project:
dotnet add package VeeFriends.LinkShortener
Usage
1. Configuration
Configure the necessary services in your Startup.cs
or Program.cs
file:
using Microsoft.Extensions.DependencyInjection;
using VeeFriends.LinkShortener;
var services = new ServiceCollection();
services.AddLinkShortener(options => {
options.AzureTableConnectionString = "your-azure-table-connection-string";
options.CloudinaryApiSecret = "your-cloudinary-api-secret";
options.CloudinaryApiKey = "your-cloudinary-api-key";
options.CloudinaryCloudName = "your-cloudinary-cloud-name";
options.LinkPreviewApiKey = "your-link-preview-api-key";
options.HostUrl = "https://your-shortener-domain.com";
});
2. Creating and Managing Links
Inject the LinkService
and use its methods to create, update, delete, and retrieve links:
public class MyLinkService
{
private readonly LinkService _linkService;
public MyLinkService(LinkService linkService)
{
_linkService = linkService;
}
public async Task CreateAndTrackAsync()
{
// Create a new short link
var link = await _linkService.CreateLink(
"My Campaign",
"https://veefriends.com",
slug: null,
expiresAt: DateTime.UtcNow.AddDays(7),
CancellationToken.None
);
// Retrieve by slug
var retrieved = await _linkService.GetLinkBySlug("your-slug", CancellationToken.None);
// Track a view (analytics)
var request = new HttpRequestMessage(HttpMethod.Get, link.ShortUrl);
await _linkService.TrackViewBySlug("your-slug", request, CancellationToken.None);
// Get analytics
var analytics = await _linkService.GetAnalyticsBySlug("your-slug", CancellationToken.None);
}
}
3. Analytics
Analytics are automatically tracked for each link visit, including:
- Request method and URL
- IP address and geo lookup (country, region, city)
- User agent, device type, OS, and browser
- Referrer
Retrieve analytics for a link:
var analytics = await linkService.GetAnalyticsBySlug("your-slug", CancellationToken.None);
foreach (var entry in analytics)
{
Console.WriteLine($"{entry.Timestamp}: {entry.IpAddress} - {entry.UserAgent}");
}
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Azure.Data.Tables (>= 12.11.0)
- CloudinaryDotNet (>= 1.27.5)
- LinkPreview (>= 1.1.4)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.6)
- Slugify.Core (>= 5.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
5.0.25 | 292 | 6/25/2025 |
5.0.24 | 131 | 6/24/2025 |
5.0.23 | 137 | 6/24/2025 |
5.0.22 | 135 | 6/24/2025 |
5.0.21 | 135 | 6/24/2025 |
5.0.20 | 136 | 6/23/2025 |
5.0.19 | 94 | 6/20/2025 |
5.0.18 | 84 | 6/20/2025 |
5.0.17 | 139 | 6/19/2025 |
5.0.16 | 137 | 6/17/2025 |
5.0.15 | 136 | 6/17/2025 |
5.0.14 | 134 | 6/17/2025 |
5.0.13 | 132 | 6/17/2025 |
5.0.12 | 136 | 6/16/2025 |
5.0.8 | 135 | 6/16/2025 |
5.0.7 | 139 | 6/16/2025 |
5.0.6 | 133 | 6/16/2025 |
5.0.4 | 134 | 6/16/2025 |
5.0.3 | 134 | 6/16/2025 |
5.0.2 | 183 | 6/13/2025 |
5.0.1 | 191 | 6/13/2025 |