File size: 754 Bytes
534df99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""
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}")