shrtnr library

Dart client for the shrtnr URL shortener API.

import 'package:shrtnr/shrtnr.dart';

final client = ShrtnrClient(
  baseUrl: 'https://your-shrtnr.example.com',
  apiKey: 'sk_...',
);

final link = await client.links.create(url: 'https://example.com');
await client.bundles.archive(7);
client.close();

Classes

AddedResult
Result of an add-link-to-bundle operation.
BreakdownPage
A page of a single-dimension analytics breakdown.
Bundle
A collection of links grouped to show combined engagement.
BundlesResource
Methods for the /api/bundles and related endpoints.
Top-link entry preview shown in a BundleWithSummary.
BundleWithSummary
Bundle enriched with range-scoped summary data.
ClickStats
Per-link click analytics breakdown.
DateCount
A date/count pair in a click timeline.
DeletedResult
Result of a delete operation.
A short link with its slugs, total click count, and metadata.
LinksResource
Methods for the /api/links and related endpoints.
NameCount
A name/count pair used in analytics breakdowns.
RemovedResult
Result of a remove-link-from-bundle or remove-slug operation.
ShrtnrClient
Top-level client for the shrtnr URL shortener API.
Slug
A short URL slug attached to a Link.
SlugCount
A slug/count pair in a per-slug analytics breakdown.
SlugsResource
Methods for slug lookup and management endpoints.
TimelineBucket
A single time bucket in a TimelineData response.
TimelineData
Click timeline with bucketed counts and period summaries.
TimelineSummary
Period-summary totals nested inside TimelineData.

Enums

BreakdownDimension
Dimension selector for the paginated breakdown endpoints.
BundleAccent
Accent color applied to a bundle.
BundleArchivedFilter
Filter for archived-bundle visibility in BundlesResource.list.
TimelineRange
Time-range filter accepted by analytics and timeline endpoints.

Exceptions / Errors

ShrtnrError
Thrown by ShrtnrClient when the API returns a 4xx/5xx response or when a network error prevents the request from completing.