| """ | |
| Run this script to convert your firebase-credentials.json to a single line for .env | |
| Usage: python format_firebase_json.py | |
| """ | |
| import json | |
| # Put your firebase JSON file path here | |
| firebase_json_path = "firebase-credentials.json" | |
| try: | |
| with open(firebase_json_path, 'r') as f: | |
| data = json.load(f) | |
| # Convert to single line | |
| single_line = json.dumps(data, separators=(',', ':')) | |
| print("\n=== Copy this line to your .env file ===\n") | |
| print(f"FIREBASE_CREDENTIALS_JSON={single_line}") | |
| print("\n" + "="*50) | |
| except FileNotFoundError: | |
| print(f"File not found: {firebase_json_path}") | |
| print("Place your firebase-credentials.json in the project folder first.") | |
| except Exception as e: | |
| print(f"Error: {e}") | |