Download client/src/utils/session.js from Mistral-AI-Game-Jam/ai-interactive-comic-book: direct link, hf CLI and curl.
- Browser
- Download file 354 Bytes
-
https://huggingface.co/spaces/Mistral-AI-Game-Jam/ai-interactive-comic-book/resolve/main/client/src/utils/session.js
- Command line
-
hf download hf://spaces/Mistral-AI-Game-Jam/ai-interactive-comic-book/client/src/utils/session.js
-
curl -L -o session.js https://huggingface.co/spaces/Mistral-AI-Game-Jam/ai-interactive-comic-book/resolve/main/client/src/utils/session.js
354 Bytes
| // Generate unique ID for client | |
| export const CLIENT_ID = `client_${Math.random().toString(36).substring(2)}`; | |
| // Create default headers for API requests | |
| export const getDefaultHeaders = (sessionId = null) => { | |
| const headers = { | |
| "x-client-id": CLIENT_ID, | |
| }; | |
| if (sessionId) { | |
| headers["x-session-id"] = sessionId; | |
| } | |
| return headers; | |
| }; | |