@@ -52,6 +52,7 @@ This will compile the TypeScript code into JavaScript in the `lib` directory, wh
5252To use Firebase Admin SDK locally:
5353
54541 . Download a service account key from your Firebase project settings:
55+
5556 - Go to [ Firebase Console] ( https://console.firebase.google.com/ )
5657 - Select your project
5758 - Go to Project Settings > Service accounts
@@ -61,11 +62,13 @@ To use Firebase Admin SDK locally:
61622 . Set the environment variable to the key file:
6263
6364** Linux / macOS** :
65+
6466``` bash
6567export GOOGLE_APPLICATION_CREDENTIALS=" /path/to/serviceAccountKey.json"
6668```
6769
6870** Windows (PowerShell)** :
71+
6972``` powershell
7073$env:GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\serviceAccountKey.json"
7174```
@@ -77,17 +80,20 @@ $env:GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\serviceAccountKey.json"
7780To test integrations locally, set these environment variables:
7881
7982** Discord** :
83+
8084``` bash
8185export DISCORD_TOKEN=" your_discord_token"
8286```
8387
8488** GitHub** :
89+
8590``` bash
8691export GITHUB_CLIENT_SECRET=" your_github_app_client_secret"
8792export GITHUB_PRIVATE_KEY=" your_github_app_private_key"
8893```
8994
9095** Internal Token** :
96+
9197``` bash
9298export INTERNAL_TOKEN=" your_internal_token"
9399```
@@ -141,11 +147,13 @@ To use Firebase Admin SDK locally:
1411472 . Set the environment variable to the key file
142148
143149** Linux / macOS** :
150+
144151``` bash
145152export GOOGLE_APPLICATION_CREDENTIALS=" /path/to/serviceAccountKey.json"
146153```
147154
148155** Windows (PowerShell)** :
156+
149157``` powershell
150158$env:GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\serviceAccountKey.json"
151159```
@@ -155,17 +163,20 @@ $env:GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\serviceAccountKey.json"
155163To test integrations locally, set these environment variables:
156164
157165** Discord** :
166+
158167``` bash
159168export DISCORD_TOKEN=" your_discord_token"
160169```
161170
162171** GitHub** :
172+
163173``` bash
164174export GITHUB_CLIENT_SECRET=" your_github_app_client_secret"
165175export GITHUB_PRIVATE_KEY=" your_github_app_private_key"
166176```
167177
168178** Internal Token** :
179+
169180``` bash
170181export INTERNAL_TOKEN=" your_internal_token"
171182```
@@ -177,16 +188,19 @@ export INTERNAL_TOKEN="your_internal_token"
177188> ** Note:** You need project access to deploy.
178189
1791901 . Login to Firebase:
191+
180192 ``` bash
181193 firebase login
182194 ```
183195
1841962 . Deploy everything:
197+
185198 ``` bash
186199 firebase deploy
187200 ```
188201
189202 Or deploy specific services:
203+
190204 ``` bash
191205 firebase deploy --only functions
192206 ```
@@ -216,25 +230,27 @@ firebase functions:config:set internal.token="your_internal_token"
216230 firebase emulators:start
217231 ```
2182324 . For hot reloading during development:
233+
219234 ``` bash
220235 # In one terminal
221236 cd functions && yarn watch
222-
223- # In another terminal
237+
238+ # In another terminal
224239 firebase emulators:start
225240 ```
241+
2262425 . Test your changes
2272436 . Deploy when ready
228244
229245## Troubleshooting
230246
231247- ** Firebase Login Issues** : Make sure you have access to the Firebase project
232- - ** Emulator Port Conflicts** :
248+ - ** Emulator Port Conflicts** :
233249 - Check for services using ports 4000, 5001, 8080, or 9000
234250 - This project uses port 5002 for hosting to avoid conflicts with AirPlay Receiver on macOS
235251 - Feel free to change any port in your local ` firebase.json ` if you encounter conflicts
236252 - See the [ Port Configuration] ( #port-configuration ) section for details
237- - ** Java Not Found Error** :
253+ - ** Java Not Found Error** :
238254 - The Firebase emulators require Java to be installed
239255 - On macOS, install Java using ` brew install openjdk@17 ` or download from [ java.com] ( https://www.java.com )
240256 - Make sure Java is on your PATH: ` java -version ` should return the installed version
@@ -245,6 +261,6 @@ firebase functions:config:set internal.token="your_internal_token"
245261- ** Admin SDK Configuration Errors** :
246262 - Set up the ` GOOGLE_APPLICATION_CREDENTIALS ` environment variable as described in the [ Set Up Credentials] ( #4-set-up-credentials ) section
247263 - For testing, you can often ignore this warning as the emulators will still run with limited functionality
248- - ** Integration Issues** :
264+ - ** Integration Issues** :
249265 - Ensure all required environment variables are correctly set
250266 - For local development without integration testing, you can often proceed without setting these variables
0 commit comments