Copies configuration values and their sealed states into this API group.
Configuration to copy. Defaults to KUTT_CONFIG.
ProtectedrequestGets the current base URL, API key, and timeout for this API group's requests.
Creates or reuses a short link using this instance's configuration.
The destination URL and optional short-link settings.
The created or reused link, with createdAt and updatedAt converted to Date objects.
HTTPError If the API returns an unsuccessful HTTP response.
Gets the API key sent in the X-API-KEY request header.
The configured API key, or an empty string when no key is set.
Gets the API base URL used to resolve endpoint paths such as v2/links.
The configured API base URL.
Gets the request timeout in milliseconds.
The configured timeout passed to AbortSignal.timeout.
Gets a page of short links using this instance's configuration.
Page size, offset, and administrator visibility settings.
Pass {} to use the API server's defaults.
A page of links with normalized dates and pagination metadata.
HTTPError If the API returns an unsuccessful HTTP response.
Deletes a short link using this instance's configuration.
The link's unique ID.
The deletion message returned by the API.
HTTPError If the API returns an unsuccessful HTTP response.
Sets the API key sent in the X-API-KEY request header.
API key to send. An empty string omits the header.
Optionalseal: boolean
Whether to prevent further changes to this setting. Defaults to false.
This instance for chained configuration calls.
Sets the API base URL used to resolve endpoint paths such as v2/links.
API root URL, such as https://kutt.to/api/.
Optionalseal: boolean
Whether to prevent further changes to this setting. Defaults to false.
This instance for chained configuration calls.
Sets the request timeout in milliseconds.
Timeout passed to AbortSignal.timeout when a request starts.
Optionalseal: boolean
Whether to prevent further changes to this setting. Defaults to false.
This instance for chained configuration calls.
Gets a short link's visit statistics using this instance's configuration.
The link's unique ID.
The link and its daily, weekly, monthly, and yearly statistics with normalized dates.
HTTPError If the API returns an unsuccessful HTTP response.
Updates a short link using this instance's configuration.
The link's unique ID.
The short-link address, destination URL, and optional changes.
The updated link, with createdAt and updatedAt converted to Date objects.
HTTPError If the API returns an unsuccessful HTTP response.
Provides Kutt v2 short-link operations using this instance's configuration.
By default, the configuration is copied from KUTT_CONFIG when the instance is created.
See
https://docs.kutt.to/#tag/links
Example