import { writable, type Writable } from "svelte/store";
import { browser } from "$app/environment";

// place files you want to import through the `$lib` alias in this folder.
export const api_host = "http://localhost:3000";
 //export let authToken: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3OTIxYTcyMTNiM2NkYjc5NGZmNzQ2MiIsImlhdCI6MTczNzcyOTYwMiwiZXhwIjoxNzM3NzUxMjAyfQ.-TlU0izsSJnZYE79yG01fcRgzgBirZBJBsiQf2alwZ4";

export let authToken: Writable<string>;
 
 if (browser) {
   authToken = writable(localStorage.getItem("token") || "");
 } else {
   authToken = writable(""); // Fallback value for SSR
 }
 