File size: 608 Bytes
60e8dd8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""
PROMPT> HUGGINGFACE_SPACES_BROWSERSTATE_SECRET=hello python -m src.huggingface_spaces.huggingface_spaces_browserstate_secret
hello

PROMPT> python -m src.huggingface_spaces.huggingface_spaces_browserstate_secret
None
"""
import os
from typing import Optional

def huggingface_spaces_browserstate_secret() -> Optional[str]:
    """
    Returns the secret key to use for encryption of the Gradio BrowserState that is stored in the browser's localStorage.
    """
    return os.getenv("HUGGINGFACE_SPACES_BROWSERSTATE_SECRET")

if __name__ == "__main__":
    print(huggingface_spaces_browserstate_secret())