Are you an LLM? You can read better optimized documentation at /api/@minimajs/cookie/namespaces/cookies/functions/get.md for this page in Markdown format
Minima.js API / @minimajs/cookie / cookies / get
Function: get()
ts
function get(name): string | undefined;Retrieves a single cookie value by name.
Parameters
name
string
The cookie name
Returns
string | undefined
The cookie value, or undefined if not found
Example
typescript
const theme = cookies.get("theme");
// theme is string | undefined
const userId = cookies.get("user-id");
if (!userId) {
throw new Error("Not authenticated");
}Since
1.0.0