File tree Expand file tree Collapse file tree 5 files changed +21
-7
lines changed Expand file tree Collapse file tree 5 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 1+ import { API_REGION } from './interfaces' ;
2+
13export const api = async (
24 method : 'GET' | 'POST' | 'PATCH' | 'DELETE' ,
3- host : string ,
5+ host : string | API_REGION ,
46 resource : string ,
57 clientId : string ,
68 userId : string ,
Original file line number Diff line number Diff line change 11import { api } from './api' ;
22import {
3+ API_REGION ,
34 BaseDeliveryOptions ,
45 Channels ,
56 DeliveryOptionsForEmail ,
67 DeliveryOptionsForInappWeb ,
78 PostUserRequest ,
8- UserAccountMetadata
9+ UserAccountMetadata ,
10+ WS_REGION
911} from './interfaces' ;
1012import {
1113 GetPreferencesResponse ,
@@ -17,14 +19,14 @@ type NotificationAPIClientSDKConfig = {
1719 userId : string ;
1820 clientId : string ;
1921 hashedUserId : string ;
20- host : string ;
22+ host : string | API_REGION ;
2123
2224 // inapp notifications:
2325 getInAppDefaultCount : number ;
2426 getInAppDefaultOldest : string ;
2527
2628 // Websocket:
27- websocketHost : string ;
29+ websocketHost : string | WS_REGION ;
2830 keepWebSocketAliveForSeconds : number ;
2931 onNewInAppNotifications ?: ( notifications : InAppNotification [ ] ) => unknown ;
3032} ;
Original file line number Diff line number Diff line change @@ -48,7 +48,17 @@ export interface WebSocket_NewNotification_Message {
4848 notifications : InAppNotification [ ] ;
4949 } ;
5050}
51+ export enum API_REGION {
52+ US = 'api.notificationapi.com' ,
53+ EU = 'api.eu.notificationapi.com' ,
54+ CA = 'api.ca.notificationapi.com'
55+ }
5156
57+ export enum WS_REGION {
58+ US = 'ws.notificationapi.com' ,
59+ EU = 'ws.eu.notificationapi.com' ,
60+ CA = 'ws.ca.notificationapi.com'
61+ }
5262export type Channels =
5363 | 'EMAIL'
5464 | 'INAPP_WEB'
Original file line number Diff line number Diff line change 11{
22 "name" : " @notificationapi/core" ,
3- "version" : " 0.0.14 " ,
3+ "version" : " 0.0.15 " ,
44 "type" : " module" ,
55 "main" : " dist/main.js" ,
66 "types" : " dist/main.d.ts" ,
You can’t perform that action at this time.
0 commit comments