Skip to content

Commit e1ed529

Browse files
committed
update firebase config
1 parent 63ed6c0 commit e1ed529

3 files changed

Lines changed: 17 additions & 10 deletions

File tree

src/api/Api.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ const MAX_RETRIES = 3
3434
/**
3535
* Adapt REST API endpoint
3636
*/
37-
export const BASE_URL = 'https://api.adapt.chat'
37+
export const BASE_URL = import.meta.env.DEV
38+
? 'http://localhost:8077'
39+
: 'https://api.adapt.chat'
3840

3941
/**
4042
* HTTP request method to use when making a request

src/api/PushNotifications.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
1+
import {getAnalytics, type Analytics} from "firebase/analytics";
12
import {FirebaseApp, initializeApp} from "firebase/app";
23
import {getMessaging, getToken, Messaging, onMessage} from "firebase/messaging";
34
import Api from "./Api";
45

56
const FIREBASE_CONFIG = {
6-
apiKey: "AIzaSyAUwv7mr1FK5BEpzJzqH1Bkb9tSj3e0KXY",
7-
authDomain: "adapt-chat.firebaseapp.com",
8-
projectId: "adapt-chat",
9-
storageBucket: "adapt-chat.appspot.com",
10-
messagingSenderId: "464541692865",
11-
appId: "1:464541692865:web:651cc571d8c787c0823540",
12-
measurementId: "G-W32V7KR3TQ"
7+
apiKey: "AIzaSyCLxCU60cABrOneUgs2rQXIzNWl9MehBlQ",
8+
authDomain: "adapt-chat-2.firebaseapp.com",
9+
projectId: "adapt-chat-2",
10+
storageBucket: "adapt-chat-2.firebasestorage.app",
11+
messagingSenderId: "516583022231",
12+
appId: "1:516583022231:web:84baa083f9e35b5b4ad3d2",
13+
measurementId: "G-PRVX9CFT8Q"
1314
} as const
1415

15-
const VAPID = 'BJ4XIJ_C9AHBXox8b5Ivm7F37ynaKEz0EAui1U9TwUWTs_qgnpz6PD3bVOaFNo9lToqe5dmhLZKT5SYyahpKRow'
16+
const VAPID = 'BAsaxzVjW2JLuRBkJpAByKG994vxkMrYBX8DLyTYqXT3beoPx2tY9hgEYWME_SsVQweXyAi1nYTUj81CMK0f6dQ'
1617

1718
/**
1819
* Handles and subscribes to push notifications via Firebase
1920
*/
2021
export default class PushNotifications {
2122
app: FirebaseApp
2223
messaging: Messaging
24+
analytics: Analytics
2325

2426
constructor(public api: Api) {
2527
this.app = initializeApp(FIREBASE_CONFIG)
2628
this.messaging = getMessaging(this.app)
29+
this.analytics = getAnalytics(this.app)
2730

2831
onMessage(this.messaging, (payload) => {
2932
console.log('[FIREBASE] Message received. ', payload)

src/api/WsClient.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ import msgpack from "tiny-msgpack";
2828
/**
2929
* WebSocket endpoint
3030
*/
31-
export const WS_CONNECT_URI: string = 'wss://harmony.adapt.chat?format=msgpack'
31+
export const WS_CONNECT_URI: string = import.meta.env.DEV
32+
? 'ws://localhost:8076?format=msgpack'
33+
: 'wss://harmony.adapt.chat?format=msgpack'
3234

3335
type WsEventHandler = (ws: WsClient, data: any) => any
3436
type WsEventListener = (data: any, remove: () => void) => any

0 commit comments

Comments
 (0)