{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "cookies-client", "dependencies": [ "js-cookie" ], "devDependencies": [ "@types/js-cookie" ], "files": [ { "path": "registry/lib/cookies.client.ts", "content": "import Cookies from \"js-cookie\"\n\ntype SameSiteOption = \"lax\" | \"strict\" | \"none\"\n\ninterface CookieOptions {\n path?: string\n secure?: boolean\n sameSite?: SameSiteOption\n domain?: string\n}\n\nconst COOKIES_DEFAULT_OPTIONS: Required> = {\n path: \"/\",\n secure: true,\n sameSite: \"lax\",\n}\n\n/**\n * This module provides a way to interact with cookies on the client.\n *\n * - `set` sets a cookie with the given name and value.\n * - `get` gets the value of a cookie with the given name.\n * - `delete` deletes a cookie with the given name.\n */\n\nexport const ClientCookies = {\n set(name: string, value: string, options: Partial = {}) {\n Cookies.set(name, value, COOKIES_DEFAULT_OPTIONS)\n },\n\n get(name: string) {\n return Cookies.get(name) || null\n },\n\n delete(name: string) {\n Cookies.remove(name, COOKIES_DEFAULT_OPTIONS)\n },\n}\n", "type": "registry:lib", "target": "lib/cookies.client.ts" } ], "type": "registry:lib" }