@mrrocket/sdk 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -176,8 +176,14 @@ interface MessengerLook {
176
176
  header?: "plain" | "color";
177
177
  /** "Powered by MRRocket" at the bottom; the server sends false only on plans that may hide it (from 0.15). */
178
178
  branding?: boolean;
179
- /** The product's icon (its favicon) at the top left of Home; without it the title's first letter. */
179
+ /** The logo at the top left of Home: the one uploaded in MRRocket, else the product's favicon; without it the title's first letter. */
180
180
  logo?: string;
181
+ /** The product's favicon, the round mark in the chat's head (from 0.17; without it the title's first letter). */
182
+ icon?: string;
183
+ /** The AI agent's name on its answers (from 0.17; empty or left out: "AI agent"). */
184
+ agentName?: string;
185
+ /** The AI agent's picture beside its answers (from 0.17). */
186
+ agentPhoto?: string;
181
187
  }
182
188
  /** The visitor's newest chat (open or closed) and its messages. */
183
189
  interface ChatThread {
@@ -274,7 +280,8 @@ type Api = ReturnType<typeof createApi>;
274
280
  * `onCancel`, and only after they succeed is the outcome recorded.
275
281
  * - `$onboarding` `{flow, step?, action: "started" | "shown" | "completed" | "dismissed"}`; since 0.11.0 a wait records
276
282
  * "shown" when the person reaches it and "completed" when it is over, a condition `{action: "answered", answer: "yes"
277
- * | "no"}` once it is decided.
283
+ * | "no"}` once it is decided; since 0.17.0 a tour a checklist task started records `{action: "started", from}` with
284
+ * the checklist's id.
278
285
  * - `$inapp` `{message, journey, action: "shown" | "clicked" | "dismissed"}`; the journey moves the person on.
279
286
  */
280
287
 
@@ -344,6 +351,17 @@ interface CancelFlowConfig {
344
351
  offersFor: "business";
345
352
  }
346
353
  type OnboardingStepKind = "tour" | "checklist" | "modal";
354
+ /** 0.17.0: where a tour bubble sits next to its element; "auto" (and no value) puts it below, else above, as before. */
355
+ type TourPlacement = "auto" | "top" | "bottom" | "left" | "right";
356
+ /**
357
+ * 0.17.0: a picture or a video above a tour step's or a modal's text. A video is a YouTube, Vimeo or Loom link (shown
358
+ * through their privacy-friendly players, see `videoEmbed`) or a video file (mp4, webm).
359
+ */
360
+ interface FlowMedia {
361
+ kind: "image" | "video";
362
+ url: string;
363
+ alt?: string;
364
+ }
347
365
  interface OnboardingStep {
348
366
  id: string;
349
367
  kind: OnboardingStepKind;
@@ -354,6 +372,14 @@ interface OnboardingStep {
354
372
  target?: string;
355
373
  /** Checklist items: the event that ticks them (`track("<event>")`). Without it the person ticks it themselves. */
356
374
  event?: string;
375
+ /** 0.17.0, tour steps: which side of the element the bubble takes (flips when there is no room). */
376
+ placement?: TourPlacement;
377
+ /** 0.17.0, tour steps and modals: a picture or a video above the text. */
378
+ media?: FlowMedia;
379
+ /** 0.17.0, modals: where the button goes (http(s) or a path of the app). */
380
+ url?: string;
381
+ /** 0.17.0, checklist items: the id of a tour (another flow) the item starts; finishing the tour ticks the item. */
382
+ startsTour?: string;
357
383
  }
358
384
  /** A pause in a flow (0.11.0): the next step shows this long after the one before was done. */
359
385
  interface OnboardingWait {
@@ -379,9 +405,15 @@ type OnboardingNode = OnboardingStep | OnboardingWait | OnboardingCondition;
379
405
  /** A live onboarding flow's in-app steps (MRRocket › Conversion › Onboarding); its emails go out from MRRocket. */
380
406
  interface OnboardingFlow {
381
407
  id: string;
408
+ /** A checklist's heading; for tours and modals the name MRRocket knows them by. */
382
409
  name: string;
383
- /** When it starts: an event's words ("Signed up", "First export"), or "First launch" / "First visit". */
410
+ /**
411
+ * When it starts: an event's words ("Signed up", "First export"), "First launch" / "First visit", since 0.17.0 a page
412
+ * of the app ("/settings", "/projects/*"), or "From a checklist" (only a checklist task starts it).
413
+ */
384
414
  trigger: string;
415
+ /** 0.17.0: "signed_in" starts it on its own only for someone the app identified. */
416
+ audience?: "signed_in";
385
417
  /** What every version shows: with `nodes`, only the in-app steps before the first wait or condition. */
386
418
  steps: OnboardingStep[];
387
419
  /** 0.11.0+: the whole flow with its waits and conditions. Read instead of `steps` when it is there. */
@@ -460,12 +492,15 @@ type FlowView = {
460
492
  index: number;
461
493
  total: number;
462
494
  last: boolean;
463
- } | {
495
+ }
496
+ /** `tour`: the tour the item starts (0.17.0), when the config has it. */
497
+ | {
464
498
  type: "checklist";
465
499
  flow: OnboardingFlow;
466
500
  items: {
467
501
  step: OnboardingStep;
468
502
  done: boolean;
503
+ tour?: OnboardingFlow;
469
504
  }[];
470
505
  } | {
471
506
  type: "message";
@@ -493,10 +528,12 @@ interface FlowsController {
493
528
  confirm(comment?: string): void;
494
529
  close(): void;
495
530
  };
531
+ /** `startTour(stepId)` (0.17.0): the tour a checklist item starts; the checklist comes back when it ends. */
496
532
  onboarding: {
497
533
  next(): void;
498
534
  check(stepId: string): void;
499
535
  dismiss(): void;
536
+ startTour(stepId: string): boolean;
500
537
  };
501
538
  message: {
502
539
  click(): void;
@@ -621,7 +658,7 @@ interface PaywallHost {
621
658
 
622
659
  type VariantId = string;
623
660
  /** This build of the SDK. Sent with the config request so MRRocket knows what the site runs (error tracking, flags). */
624
- declare const SDK_VERSION = "0.16.0";
661
+ declare const SDK_VERSION = "0.17.0";
625
662
  /** One variant of an experiment. `changes` replaces texts that the page marks with `<Text id>`. */
626
663
  interface VariantConfig {
627
664
  id: VariantId;
@@ -1039,8 +1076,10 @@ interface NativeMessengerOptions {
1039
1076
  corners?: MessengerCorners;
1040
1077
  /** Home's top: plain like the rest (default), or in the accent color with raised cards. */
1041
1078
  header?: "plain" | "color";
1042
- /** The product's icon at the top left of Home (MRRocket sends the product's favicon). */
1079
+ /** The logo at the top left of Home (MRRocket sends the uploaded logo, else the product's favicon). */
1043
1080
  logo?: string;
1081
+ /** The AI agent's name on its answers (default "AI agent"). */
1082
+ agentName?: string;
1044
1083
  /** Ask people the app did not identify with an email for an email (optional for them). Default true. */
1045
1084
  askEmail?: boolean;
1046
1085
  /** The Help tab with your published help articles (default true; hidden while there are none). */
@@ -1208,4 +1247,4 @@ declare const useExpoRouterTracking: () => void;
1208
1247
  */
1209
1248
  declare const useNavigationTracking: () => (state: unknown) => void;
1210
1249
 
1211
- export { type AppContext, type CancelFlowConfig, type CancelFlowOptions, type CancelFlowResult, type CancelOffer, type ChatMessage, type ChatThread, type CockpitConfig, type FeedbackPost, type FlagConfig, type FlowView, type IdentifyOptions, type InAppMessage, type KeyValueStorage, type MRRocketClient, MRRocketFeedback, MRRocketFlows, MRRocketMask, MRRocketMessenger, type MRRocketOptions, MRRocketProvider, type MRRocketProviderProps, MRRocketSurveys, type NativeAppearance, type NativeConsent, type NativeFeedbackOptions, type NativeMessengerOptions, type NativePushResult, type NativePushStatus, type NativeReviewResult, type OnboardingFlow, type OnboardingStep, type PaywallConfig, type PaywallOptions, type PaywallPage, type PaywallPlan, type PaywallResult, type RegisterForPushOptions, SDK_VERSION, type SurveyDefinition, type VariantId, activeRouteName, createMRRocket, getMRRocket, useCancelFlow, useExpoRouterTracking, useFeedback, useFlag, useFlagVariant, useMRRocket, useMessenger, useNavigationTracking, useOnboarding, usePaywall, usePush, useReview, useText, useVariant };
1250
+ export { type AppContext, type CancelFlowConfig, type CancelFlowOptions, type CancelFlowResult, type CancelOffer, type ChatMessage, type ChatThread, type CockpitConfig, type FeedbackPost, type FlagConfig, type FlowMedia, type FlowView, type IdentifyOptions, type InAppMessage, type KeyValueStorage, type MRRocketClient, MRRocketFeedback, MRRocketFlows, MRRocketMask, MRRocketMessenger, type MRRocketOptions, MRRocketProvider, type MRRocketProviderProps, MRRocketSurveys, type NativeAppearance, type NativeConsent, type NativeFeedbackOptions, type NativeMessengerOptions, type NativePushResult, type NativePushStatus, type NativeReviewResult, type OnboardingFlow, type OnboardingStep, type PaywallConfig, type PaywallOptions, type PaywallPage, type PaywallPlan, type PaywallResult, type RegisterForPushOptions, SDK_VERSION, type SurveyDefinition, type TourPlacement, type VariantId, activeRouteName, createMRRocket, getMRRocket, useCancelFlow, useExpoRouterTracking, useFeedback, useFlag, useFlagVariant, useMRRocket, useMessenger, useNavigationTracking, useOnboarding, usePaywall, usePush, useReview, useText, useVariant };
@@ -176,8 +176,14 @@ interface MessengerLook {
176
176
  header?: "plain" | "color";
177
177
  /** "Powered by MRRocket" at the bottom; the server sends false only on plans that may hide it (from 0.15). */
178
178
  branding?: boolean;
179
- /** The product's icon (its favicon) at the top left of Home; without it the title's first letter. */
179
+ /** The logo at the top left of Home: the one uploaded in MRRocket, else the product's favicon; without it the title's first letter. */
180
180
  logo?: string;
181
+ /** The product's favicon, the round mark in the chat's head (from 0.17; without it the title's first letter). */
182
+ icon?: string;
183
+ /** The AI agent's name on its answers (from 0.17; empty or left out: "AI agent"). */
184
+ agentName?: string;
185
+ /** The AI agent's picture beside its answers (from 0.17). */
186
+ agentPhoto?: string;
181
187
  }
182
188
  /** The visitor's newest chat (open or closed) and its messages. */
183
189
  interface ChatThread {
@@ -274,7 +280,8 @@ type Api = ReturnType<typeof createApi>;
274
280
  * `onCancel`, and only after they succeed is the outcome recorded.
275
281
  * - `$onboarding` `{flow, step?, action: "started" | "shown" | "completed" | "dismissed"}`; since 0.11.0 a wait records
276
282
  * "shown" when the person reaches it and "completed" when it is over, a condition `{action: "answered", answer: "yes"
277
- * | "no"}` once it is decided.
283
+ * | "no"}` once it is decided; since 0.17.0 a tour a checklist task started records `{action: "started", from}` with
284
+ * the checklist's id.
278
285
  * - `$inapp` `{message, journey, action: "shown" | "clicked" | "dismissed"}`; the journey moves the person on.
279
286
  */
280
287
 
@@ -344,6 +351,17 @@ interface CancelFlowConfig {
344
351
  offersFor: "business";
345
352
  }
346
353
  type OnboardingStepKind = "tour" | "checklist" | "modal";
354
+ /** 0.17.0: where a tour bubble sits next to its element; "auto" (and no value) puts it below, else above, as before. */
355
+ type TourPlacement = "auto" | "top" | "bottom" | "left" | "right";
356
+ /**
357
+ * 0.17.0: a picture or a video above a tour step's or a modal's text. A video is a YouTube, Vimeo or Loom link (shown
358
+ * through their privacy-friendly players, see `videoEmbed`) or a video file (mp4, webm).
359
+ */
360
+ interface FlowMedia {
361
+ kind: "image" | "video";
362
+ url: string;
363
+ alt?: string;
364
+ }
347
365
  interface OnboardingStep {
348
366
  id: string;
349
367
  kind: OnboardingStepKind;
@@ -354,6 +372,14 @@ interface OnboardingStep {
354
372
  target?: string;
355
373
  /** Checklist items: the event that ticks them (`track("<event>")`). Without it the person ticks it themselves. */
356
374
  event?: string;
375
+ /** 0.17.0, tour steps: which side of the element the bubble takes (flips when there is no room). */
376
+ placement?: TourPlacement;
377
+ /** 0.17.0, tour steps and modals: a picture or a video above the text. */
378
+ media?: FlowMedia;
379
+ /** 0.17.0, modals: where the button goes (http(s) or a path of the app). */
380
+ url?: string;
381
+ /** 0.17.0, checklist items: the id of a tour (another flow) the item starts; finishing the tour ticks the item. */
382
+ startsTour?: string;
357
383
  }
358
384
  /** A pause in a flow (0.11.0): the next step shows this long after the one before was done. */
359
385
  interface OnboardingWait {
@@ -379,9 +405,15 @@ type OnboardingNode = OnboardingStep | OnboardingWait | OnboardingCondition;
379
405
  /** A live onboarding flow's in-app steps (MRRocket › Conversion › Onboarding); its emails go out from MRRocket. */
380
406
  interface OnboardingFlow {
381
407
  id: string;
408
+ /** A checklist's heading; for tours and modals the name MRRocket knows them by. */
382
409
  name: string;
383
- /** When it starts: an event's words ("Signed up", "First export"), or "First launch" / "First visit". */
410
+ /**
411
+ * When it starts: an event's words ("Signed up", "First export"), "First launch" / "First visit", since 0.17.0 a page
412
+ * of the app ("/settings", "/projects/*"), or "From a checklist" (only a checklist task starts it).
413
+ */
384
414
  trigger: string;
415
+ /** 0.17.0: "signed_in" starts it on its own only for someone the app identified. */
416
+ audience?: "signed_in";
385
417
  /** What every version shows: with `nodes`, only the in-app steps before the first wait or condition. */
386
418
  steps: OnboardingStep[];
387
419
  /** 0.11.0+: the whole flow with its waits and conditions. Read instead of `steps` when it is there. */
@@ -460,12 +492,15 @@ type FlowView = {
460
492
  index: number;
461
493
  total: number;
462
494
  last: boolean;
463
- } | {
495
+ }
496
+ /** `tour`: the tour the item starts (0.17.0), when the config has it. */
497
+ | {
464
498
  type: "checklist";
465
499
  flow: OnboardingFlow;
466
500
  items: {
467
501
  step: OnboardingStep;
468
502
  done: boolean;
503
+ tour?: OnboardingFlow;
469
504
  }[];
470
505
  } | {
471
506
  type: "message";
@@ -493,10 +528,12 @@ interface FlowsController {
493
528
  confirm(comment?: string): void;
494
529
  close(): void;
495
530
  };
531
+ /** `startTour(stepId)` (0.17.0): the tour a checklist item starts; the checklist comes back when it ends. */
496
532
  onboarding: {
497
533
  next(): void;
498
534
  check(stepId: string): void;
499
535
  dismiss(): void;
536
+ startTour(stepId: string): boolean;
500
537
  };
501
538
  message: {
502
539
  click(): void;
@@ -621,7 +658,7 @@ interface PaywallHost {
621
658
 
622
659
  type VariantId = string;
623
660
  /** This build of the SDK. Sent with the config request so MRRocket knows what the site runs (error tracking, flags). */
624
- declare const SDK_VERSION = "0.16.0";
661
+ declare const SDK_VERSION = "0.17.0";
625
662
  /** One variant of an experiment. `changes` replaces texts that the page marks with `<Text id>`. */
626
663
  interface VariantConfig {
627
664
  id: VariantId;
@@ -1039,8 +1076,10 @@ interface NativeMessengerOptions {
1039
1076
  corners?: MessengerCorners;
1040
1077
  /** Home's top: plain like the rest (default), or in the accent color with raised cards. */
1041
1078
  header?: "plain" | "color";
1042
- /** The product's icon at the top left of Home (MRRocket sends the product's favicon). */
1079
+ /** The logo at the top left of Home (MRRocket sends the uploaded logo, else the product's favicon). */
1043
1080
  logo?: string;
1081
+ /** The AI agent's name on its answers (default "AI agent"). */
1082
+ agentName?: string;
1044
1083
  /** Ask people the app did not identify with an email for an email (optional for them). Default true. */
1045
1084
  askEmail?: boolean;
1046
1085
  /** The Help tab with your published help articles (default true; hidden while there are none). */
@@ -1208,4 +1247,4 @@ declare const useExpoRouterTracking: () => void;
1208
1247
  */
1209
1248
  declare const useNavigationTracking: () => (state: unknown) => void;
1210
1249
 
1211
- export { type AppContext, type CancelFlowConfig, type CancelFlowOptions, type CancelFlowResult, type CancelOffer, type ChatMessage, type ChatThread, type CockpitConfig, type FeedbackPost, type FlagConfig, type FlowView, type IdentifyOptions, type InAppMessage, type KeyValueStorage, type MRRocketClient, MRRocketFeedback, MRRocketFlows, MRRocketMask, MRRocketMessenger, type MRRocketOptions, MRRocketProvider, type MRRocketProviderProps, MRRocketSurveys, type NativeAppearance, type NativeConsent, type NativeFeedbackOptions, type NativeMessengerOptions, type NativePushResult, type NativePushStatus, type NativeReviewResult, type OnboardingFlow, type OnboardingStep, type PaywallConfig, type PaywallOptions, type PaywallPage, type PaywallPlan, type PaywallResult, type RegisterForPushOptions, SDK_VERSION, type SurveyDefinition, type VariantId, activeRouteName, createMRRocket, getMRRocket, useCancelFlow, useExpoRouterTracking, useFeedback, useFlag, useFlagVariant, useMRRocket, useMessenger, useNavigationTracking, useOnboarding, usePaywall, usePush, useReview, useText, useVariant };
1250
+ export { type AppContext, type CancelFlowConfig, type CancelFlowOptions, type CancelFlowResult, type CancelOffer, type ChatMessage, type ChatThread, type CockpitConfig, type FeedbackPost, type FlagConfig, type FlowMedia, type FlowView, type IdentifyOptions, type InAppMessage, type KeyValueStorage, type MRRocketClient, MRRocketFeedback, MRRocketFlows, MRRocketMask, MRRocketMessenger, type MRRocketOptions, MRRocketProvider, type MRRocketProviderProps, MRRocketSurveys, type NativeAppearance, type NativeConsent, type NativeFeedbackOptions, type NativeMessengerOptions, type NativePushResult, type NativePushStatus, type NativeReviewResult, type OnboardingFlow, type OnboardingStep, type PaywallConfig, type PaywallOptions, type PaywallPage, type PaywallPlan, type PaywallResult, type RegisterForPushOptions, SDK_VERSION, type SurveyDefinition, type TourPlacement, type VariantId, activeRouteName, createMRRocket, getMRRocket, useCancelFlow, useExpoRouterTracking, useFeedback, useFlag, useFlagVariant, useMRRocket, useMessenger, useNavigationTracking, useOnboarding, usePaywall, usePush, useReview, useText, useVariant };