diff --git a/src/lib/ShortURL.svelte b/src/lib/ShortURL.svelte
index a16ec56..666f52a 100644
--- a/src/lib/ShortURL.svelte
+++ b/src/lib/ShortURL.svelte
@@ -1,5 +1,5 @@
@@ -93,6 +96,14 @@
+
{
+interface Options {
+ path?: string
+ title?: string
+}
+
+export async function getShortLink(url: string, options?: Options): Promise {
const body = {
domain: import.meta.env.VITE_SHORT_IO_DOMAIN,
originalURL: url,
- path: customPath,
+ path: !options?.path ? undefined : options.path,
+ title: !options?.title ? undefined : options.title,
}
const { data } = await axios.post('https://api.short.io/links/public', body, {