Skip to main content
Get up and running with shrtnr in under 5 minutes. This guide walks you through creating your first short link, both as a guest and as an authenticated user.
1

Visit the home page

Navigate to your shrtnr instance homepage. You’ll see a clean interface with a URL input field.
2

Paste your long URL

Enter any valid HTTP or HTTPS URL in the input field:
https://example.com/very/long/path/to/your/content?with=parameters
3

Click Shorten

Click the Shorten button. shrtnr generates an 8-character short code and automatically copies the short link to your clipboard.
https://yoursite.com/aB3xY7kL
4

Share your short link

Paste the short link anywhere - social media, emails, SMS. Anyone who clicks it gets redirected to your original URL instantly.
Guest links expire in 7 days. Create an account to customize expiration, use custom slugs, and track analytics.
Unlock the full power of shrtnr with a free account:
1

Navigate to registration

Click Sign up in the navigation bar or visit /register.
2

Fill in your details

Provide your email, name, and a password (minimum 8 characters).
// Registration requirements from app/api/auth/register/route.ts:22-23
if (!email || !password || password.length < 8) {
  return NextResponse.json({ error: 'Invalid input' }, { status: 400 });
}
3

Sign in

After registration, sign in with your credentials. shrtnr uses NextAuth.js with JWT sessions that last 30 days.
Once you’re signed in, you can create branded short links:
1

Enter your URL

Paste your long URL as before.
2

Add a custom slug (optional)

In the “Custom slug” field, enter a memorable slug:
  • Allowed: letters, numbers, hyphens (-), underscores (_)
  • Length: 1-20 characters
  • Example: spring-sale, contact_us, promo2024
// Validation regex from app/lib/links.ts:9
const SLUG_REGEX = /^[a-zA-Z0-9_-]{1,20}$/;
3

Set expiration (optional)

Choose how many days until the link expires (1-30 days, default 7).
// From app/lib/links.ts:6-7
const DEFAULT_EXPIRY_DAYS = 7;
const MAX_EXPIRY_DAYS = 30;
4

Create your link

Click Shorten. Your custom short link is created and copied to your clipboard:
https://yoursite.com/spring-sale
Custom slugs must be unique. If someone already took promo, try promo-2024 or spring-promo.

View Your Dashboard

Authenticated users get a powerful dashboard to manage all their links:
1

Navigate to the dashboard

Click Dashboard in the navigation or visit /dashboard.
2

See all your links

The dashboard displays all your short links with:
  • Short code and full short URL
  • Original destination URL
  • Expiration date
  • Click count (analytics)
  • Edit and Delete actions
3

Copy or share links

Click the copy icon next to any link to copy it to your clipboard instantly.

Dashboard Features

The dashboard provides a complete overview:
// Link data structure from app/dashboard/page.tsx:36-45
type LinkRow = {
  id: number;
  short_code: string;
  original_url: string;
  created_at: string;
  expires_at: string | null;
  custom_slug: boolean;
  clicks: number;
  user_id: string | null;
};
Desktop view: Full data table with sortable columns Mobile view: Card-based layout optimized for touch Every short link automatically tracks clicks:
  1. Click count: See total clicks in your dashboard
  2. Analytics data: Each click records:
    • IP address (first segment for privacy)
    • User agent (browser/device)
    • Referrer (where the click came from)
    • Timestamp
// From app/lib/links.ts:96-100
const ip = headers?.get('x-forwarded-for')?.split(',')[0]?.trim()
  ?? headers?.get('x-real-ip')?.trim()
  ?? null;
const userAgent = headers?.get('user-agent') ?? null;
const referrer = headers?.get('referer') ?? headers?.get('referrer') ?? null;
Analytics are tracked automatically. No configuration needed. View click counts in your dashboard.
Manage your links from the dashboard:
  1. Click Edit next to the link you want to modify
  2. Update the custom slug or expiration date
  3. Click Save
Changing a slug makes the old link stop working immediately. Use with caution for widely-shared links.
  1. Click Delete next to the link
  2. Confirm the deletion
  3. The link is permanently removed and stops redirecting

Common Workflows

1. Paste URL
2. Click Shorten
3. Share the auto-generated link (expires in 7 days)
1. Sign in
2. Paste campaign URL
3. Add custom slug: summer-2024
4. Set expiration: 30 days
5. Share branded link
6. Track clicks in dashboard
1. Sign in
2. Paste event registration URL
3. Set expiration: 3 days
4. Share with attendees
5. Link expires automatically after event

API Integration (Optional)

Developers can integrate shrtnr via the API:
curl -X POST https://yoursite.com/api/shorten \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/very/long/url",
    "customSlug": "my-link",
    "expiresInDays": 14
  }'
Custom slugs and custom expiration require authentication. See the API Authentication guide for details.

Troubleshooting

”Invalid URL”

Your URL must start with http:// or https://:
// From app/lib/links.ts:11-17
function isValidUrl(s: string): boolean {
  try {
    const u = new URL(s);
    return u.protocol === 'http:' || u.protocol === 'https:';
  } catch {
    return false;
  }
}
Fix: Make sure your URL includes the protocol.

”Slug already in use”

Someone else already created a link with that custom slug. Fix: Choose a different slug or add a number/date: promopromo-2024.

”Sign in to use a custom slug”

Custom slugs are only available to authenticated users. Fix: Create a free account or use the auto-generated 8-character code.

Next Steps

Custom Slugs

Create memorable, branded short links

Analytics

Track clicks and understand your audience

Dashboard

Manage all your links in one place

API Reference

Integrate shrtnr into your applications

Build docs developers (and LLMs) love