diff --git a/lib/client.ts b/lib/client.ts index e381767..21ed5c6 100644 --- a/lib/client.ts +++ b/lib/client.ts @@ -4,7 +4,8 @@ import { Channels, DeliveryOptionsForEmail, DeliveryOptionsForInappWeb, - PostUserRequest + PostUserRequest, + UserAccountMetadata } from './interfaces'; import { GetPreferencesResponse, @@ -71,6 +72,7 @@ type NotificationAPIClientSDK = { }> ): Promise; postUser(params: PostUserRequest): Promise; + getUserAccountMetadata(): Promise; }; websocket: { object: WebSocket | undefined; @@ -104,6 +106,7 @@ type NotificationAPIClientSDK = { }): Promise; getPreferences(): Promise; identify(params: PostUserRequest): Promise; + getUserAccountMetadata(): Promise; }; export const NotificationAPIClientSDK: NotificationAPIClientSDK = { @@ -156,6 +159,9 @@ export const NotificationAPIClientSDK: NotificationAPIClientSDK = { }, postUser: function (params: PostUserRequest) { return NotificationAPIClientSDK.rest.generic('POST', '', params); + }, + getUserAccountMetadata: function () { + return NotificationAPIClientSDK.rest.generic('GET', 'account_metadata'); } }, websocket: { @@ -293,5 +299,8 @@ export const NotificationAPIClientSDK: NotificationAPIClientSDK = { ); } return NotificationAPIClientSDK.rest.postUser(params); + }, + getUserAccountMetadata: async () => { + return NotificationAPIClientSDK.rest.getUserAccountMetadata(); } }; diff --git a/lib/interfaces.ts b/lib/interfaces.ts index c72ae03..30e66bc 100644 --- a/lib/interfaces.ts +++ b/lib/interfaces.ts @@ -203,3 +203,8 @@ export interface PushSubscription { export interface WebPushToken { sub: PushSubscription; } +export interface UserAccountMetadata { + logo: string; + environmentVapidPublicKey: string; + hasWebPushEnabled: boolean; +}