SmartInc-API / firestore_client.py
yoursdvniel's picture
Create firestore_client.py
d1c6cd6 verified
import os
import json
from google.cloud import firestore
from google.oauth2 import service_account
def get_firestore_client():
creds = json.loads(os.environ['FIREBASE_CREDENTIALS_JSON'])
credentials = service_account.Credentials.from_service_account_info(creds)
return firestore.Client(credentials=credentials)