braze-plugin
v0.0.2
Published
.
Readme
braze-plugin
.
Install
npm install braze-plugin
npx cap syncAPI
echo(...)initialize(...)changeUser(...)getUserId()logCustomEvent(...)setUserAttributionData(...)setCustomUserAttribute(...)setUserProfile(...)logPurchase(...)- Type Aliases
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>| Param | Type |
| ------------- | ------------------------------- |
| options | { value: string; } |
Returns: Promise<{ value: string; }>
initialize(...)
initialize(options: { apiKey: string; apiEndpoint: string; }) => Promise<void>| Param | Type |
| ------------- | ----------------------------------------------------- |
| options | { apiKey: string; apiEndpoint: string; } |
changeUser(...)
changeUser(options: { userId: string; sdkAuthenticationToken: string; }) => Promise<void>| Param | Type |
| ------------- | ---------------------------------------------------------------- |
| options | { userId: string; sdkAuthenticationToken: string; } |
getUserId()
getUserId() => Promise<{ userId: string; }>Returns: Promise<{ userId: string; }>
logCustomEvent(...)
logCustomEvent(options: { eventName: string; eventProperties: Record<string, any>; }) => Promise<void>| Param | Type |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| options | { eventName: string; eventProperties: Record<string, any>; } |
setUserAttributionData(...)
setUserAttributionData(options: { network: string; campaign: string; adgroup: string; creative: string; }) => Promise<void>| Param | Type |
| ------------- | -------------------------------------------------------------------------------------- |
| options | { network: string; campaign: string; adgroup: string; creative: string; } |
setCustomUserAttribute(...)
setCustomUserAttribute(options: { key: string; value: any; merge?: boolean; }) => Promise<void>| Param | Type |
| ------------- | ---------------------------------------------------------- |
| options | { key: string; value: any; merge?: boolean; } |
setUserProfile(...)
setUserProfile(options: { email?: string; firstName?: string; lastName?: string; year?: number; month?: number; day?: number; homeCity?: string; phoneNumber?: string; pushStatus?: 'opted_in' | 'subscribed' | 'unsubscribed'; emailStatus?: 'opted_in' | 'subscribed' | 'unsubscribed'; }) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| options | { email?: string; firstName?: string; lastName?: string; year?: number; month?: number; day?: number; homeCity?: string; phoneNumber?: string; pushStatus?: 'opted_in' | 'subscribed' | 'unsubscribed'; emailStatus?: 'opted_in' | 'subscribed' | 'unsubscribed'; } |
logPurchase(...)
logPurchase(options: { productId: string; currency: string; price: number; quantity?: number; properties?: Record<string, any>; }) => Promise<void>| Param | Type |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| options | { productId: string; currency: string; price: number; quantity?: number; properties?: Record<string, any>; } |
Type Aliases
Record
Construct a type with a set of properties K of type T
{ [P in K]: T; }
capacitor.config.ts changes for your local project
import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
....
plugins: {
BrazePlugin: {
ios: {
disableAutomaticPushRegistration: false,
disableAutomaticPushHandling: false,
enableIDFACollection: true,
enableLocationCollection: false,
enableGeofences: false,
sessionTimeout: 5,
enableSDKAuth: true,
displayForegroundPushNotifications: true,
minimumBuildVersion: '12.0',
disableProvisionalAuth: false,
triggerMinimumTimeInterval: 1,
pushAppGroup: 'group.com.braze.hellocordova.PushStories',
forwardUniversalLinks: true,
logLevel: 2,
useUUIDAsDeviceId: true,
flushInterval: 10,
useAutomaticRequestPolicy: true,
optInWhenPushAuthorized: true
},
android: {
GradlePluginKotlinEnabled: true,
GradlePluginKotlinCodeStyle: "official",
GradlePluginKotlinVersion: "1.9.24",
androidTargetSdkVersion: 35,
androidCompileSdkVersion: 35,
androidMinSdkVersion: 25,
GradleVersion: "8.7",
AndroidXEnabled: true,
com_braze_firebase_cloud_messaging_registration_enabled: true,
com_braze_android_fcm_sender_id: "str_900857597716",
com_braze_android_default_session_timeout: "str_5",
com_braze_android_handle_push_deep_links_automatically: true,
com_braze_android_log_level: "str_4",
com_braze_android_small_notification_icon: "",
com_braze_android_large_notification_icon: "",
com_braze_android_notification_accent_color: "0x0000",
com_braze_enable_location_collection: false,
com_braze_geofences_enabled: false,
com_braze_android_disable_auto_session_tracking: false,
com_braze_sdk_authentication_enabled: true,
com_braze_is_session_start_based_timeout_enabled: false,
com_braze_default_notification_channel_name: "Braze Push",
com_braze_default_notification_channel_description: "Braze related push",
com_braze_does_push_story_dismiss_on_click: true,
com_braze_is_fallback_firebase_messaging_service_enabled: true,
com_braze_fallback_firebase_messaging_service_classpath: "com.braze.push.BrazeFirebaseMessagingService",
com_braze_is_content_cards_unread_visual_indicator_enabled: true,
com_braze_is_firebase_messaging_service_on_new_token_registration_enabled: true,
com_braze_is_push_deep_link_back_stack_activity_enabled: true,
com_braze_push_deep_link_back_stack_activity_class_name: "java.lang.BackStackActivityClass",
com_braze_should_opt_in_when_push_authorized: true,
com_braze_trigger_action_minimum_time_interval_seconds: "str_1"
}
}
}
};
export default config;