@mrrocket/sdk 0.14.0 → 0.16.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +45 -4
  3. package/dist/api-client.d.ts +67 -5
  4. package/dist/api-client.js +39 -8
  5. package/dist/api-client.js.map +1 -1
  6. package/dist/api.d.ts +4 -1
  7. package/dist/api.js +2 -1
  8. package/dist/api.js.map +1 -1
  9. package/dist/batch.d.ts +6 -4
  10. package/dist/batch.js +3 -3
  11. package/dist/batch.js.map +1 -1
  12. package/dist/browser/mrrocket-flows.js +2 -2
  13. package/dist/browser/mrrocket-forms.js +1 -1
  14. package/dist/browser/mrrocket-messenger.js +202 -46
  15. package/dist/browser/mrrocket-push.js +1 -1
  16. package/dist/browser/mrrocket-replay.js +3 -3
  17. package/dist/browser/mrrocket.js +1 -1
  18. package/dist/client.d.ts +10 -2
  19. package/dist/client.js +36 -15
  20. package/dist/client.js.map +1 -1
  21. package/dist/context.d.ts +5 -1
  22. package/dist/context.js.map +1 -1
  23. package/dist/core.d.ts +1 -1
  24. package/dist/core.js +1 -1
  25. package/dist/core.js.map +1 -1
  26. package/dist/errors.d.ts +5 -1
  27. package/dist/errors.js +8 -2
  28. package/dist/errors.js.map +1 -1
  29. package/dist/flows-ui.js +48 -1
  30. package/dist/flows-ui.js.map +1 -1
  31. package/dist/flows-web.d.ts +2 -0
  32. package/dist/flows-web.js +4 -1
  33. package/dist/flows-web.js.map +1 -1
  34. package/dist/flows.d.ts +61 -1
  35. package/dist/flows.js +64 -21
  36. package/dist/flows.js.map +1 -1
  37. package/dist/forms.d.ts +4 -0
  38. package/dist/forms.js +4 -1
  39. package/dist/forms.js.map +1 -1
  40. package/dist/identity.d.ts +42 -0
  41. package/dist/identity.js +24 -0
  42. package/dist/identity.js.map +1 -0
  43. package/dist/index.d.ts +2 -0
  44. package/dist/index.js.map +1 -1
  45. package/dist/messenger-ui.d.ts +21 -6
  46. package/dist/messenger-ui.js +334 -80
  47. package/dist/messenger-ui.js.map +1 -1
  48. package/dist/messenger.d.ts +11 -3
  49. package/dist/messenger.js +9 -5
  50. package/dist/messenger.js.map +1 -1
  51. package/dist/push-web.d.ts +2 -13
  52. package/dist/push-web.js +4 -2
  53. package/dist/push-web.js.map +1 -1
  54. package/dist/react-native/index.d.cts +162 -14
  55. package/dist/react-native/index.d.ts +162 -14
  56. package/dist/react-native/index.js +552 -207
  57. package/dist/react-native/index.js.map +1 -1
  58. package/dist/replay.d.ts +4 -1
  59. package/dist/replay.js +8 -2
  60. package/dist/replay.js.map +1 -1
  61. package/dist/server.d.ts +2 -0
  62. package/dist/server.js +2 -0
  63. package/dist/server.js.map +1 -1
  64. package/dist/styles-css.d.ts +1 -1
  65. package/dist/styles-css.js +200 -44
  66. package/dist/styles-css.js.map +1 -1
  67. package/dist/user-hash.d.ts +27 -0
  68. package/dist/user-hash.js +24 -0
  69. package/dist/user-hash.js.map +1 -0
  70. package/package.json +9 -1
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Identity verification (0.16.0), the browser and app side. After `identify(id)` the SDK's id is your app's own user
3
+ * id, and that id is no secret (a Clerk id shows in URLs and logs), so on its own it proves nothing: anyone who knows it
4
+ * could read that person's support chat or post as them. Your server signs the id with the product's server key
5
+ * (`userHash(user.id)` from `@mrrocket/sdk/next/server`) and you hand the result to `identify(id, props, { hash })`.
6
+ * From then on every request for that id carries it as `userHash` (a JSON field, a query parameter or a form field), and
7
+ * MRRocket checks it.
8
+ *
9
+ * The hash belongs to one id: it is forgotten on `reset()` (sign-out) and when `identify` is called for another id
10
+ * without a hash, so it never goes out with someone else's id (MRRocket refuses a hash that does not match with 401).
11
+ * Shared by the Next.js provider, the script tag and React Native: no React, no browser APIs.
12
+ */
13
+ /** The third argument of `identify`. */
14
+ export interface IdentifyOptions {
15
+ /**
16
+ * The id signed by your server: `await userHash(user.id)` from `@mrrocket/sdk/next/server` (or the same HMAC in any
17
+ * language). Needed when MRRocket › Settings › Products › Sign-in › "Only signed users" is on.
18
+ */
19
+ hash?: string;
20
+ }
21
+ /** The id the SDK holds a hash for, and the hash. */
22
+ export interface Signed {
23
+ id: string;
24
+ hash: string;
25
+ }
26
+ /** What to do when MRRocket refuses a request for want of a hash (once per page, in the console). Short: sdk.js has a size budget. */
27
+ export declare const UNSIGNED_HELP = "401: sign the user id on your server with userHash(id) from @mrrocket/sdk/next/server and pass identify(id, props, { hash }).";
28
+ /** Says once per page (or app run) why MRRocket answered 401; other statuses say nothing. */
29
+ export declare const warnUnsigned: (status: number, log?: (message: string) => void) => void;
30
+ /**
31
+ * The signed id after `identify(id, …, { hash })`: a new hash replaces the old one, the same id without a hash keeps
32
+ * the one it has, another id without a hash drops it. A hash that is not 64 hex characters (a typo, the server key
33
+ * itself) is ignored with a warning instead of being sent.
34
+ */
35
+ export declare const nextSigned: (signed: Signed | null, id: string, hash: unknown, log?: (message: string) => void) => Signed | null;
36
+ /** The hash for `id`, when the SDK holds one for exactly that id. */
37
+ export declare const hashFor: (signed: Signed | null | undefined, id: string | undefined) => string | undefined;
38
+ /**
39
+ * The hash for a request that carries several items with their own ids (error reports): only when every item that
40
+ * names someone names the signed id, so a report of an earlier visitor never goes out under this person's hash.
41
+ */
42
+ export declare const hashForAll: (signed: Signed | null | undefined, ids: (string | undefined)[]) => string | undefined;
@@ -0,0 +1,24 @@
1
+ // src/identity.ts
2
+ var UNSIGNED_HELP = "401: sign the user id on your server with userHash(id) from @mrrocket/sdk/next/server and pass identify(id, props, { hash }).";
3
+ var warnUnsigned = (status, log = (m) => console.warn(m)) => {
4
+ const g = globalThis;
5
+ if (status !== 401 || g.__mrrocketUnsigned) return;
6
+ g.__mrrocketUnsigned = true;
7
+ log(`[MRRocket] ${UNSIGNED_HELP}`);
8
+ };
9
+ var nextSigned = (signed, id, hash, log = (m) => console.warn(m)) => {
10
+ const h = typeof hash === "string" ? hash.trim().toLowerCase() : "";
11
+ if (/^[0-9a-f]{64}$/.test(h)) return { id, hash: h };
12
+ if (h) log("[MRRocket] identify: that hash is no userHash(id); not sent.");
13
+ return signed && signed.id === id ? signed : null;
14
+ };
15
+ var hashFor = (signed, id) => signed && id && signed.id === id ? signed.hash : void 0;
16
+ var hashForAll = (signed, ids) => signed && ids.some((id) => id === signed.id) && ids.every((id) => !id || id === signed.id) ? signed.hash : void 0;
17
+ export {
18
+ UNSIGNED_HELP,
19
+ hashFor,
20
+ hashForAll,
21
+ nextSigned,
22
+ warnUnsigned
23
+ };
24
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/identity.ts"],"sourcesContent":["/**\n * Identity verification (0.16.0), the browser and app side. After `identify(id)` the SDK's id is your app's own user\n * id, and that id is no secret (a Clerk id shows in URLs and logs), so on its own it proves nothing: anyone who knows it\n * could read that person's support chat or post as them. Your server signs the id with the product's server key\n * (`userHash(user.id)` from `@mrrocket/sdk/next/server`) and you hand the result to `identify(id, props, { hash })`.\n * From then on every request for that id carries it as `userHash` (a JSON field, a query parameter or a form field), and\n * MRRocket checks it.\n *\n * The hash belongs to one id: it is forgotten on `reset()` (sign-out) and when `identify` is called for another id\n * without a hash, so it never goes out with someone else's id (MRRocket refuses a hash that does not match with 401).\n * Shared by the Next.js provider, the script tag and React Native: no React, no browser APIs.\n */\n\n/** The third argument of `identify`. */\nexport interface IdentifyOptions {\n /**\n * The id signed by your server: `await userHash(user.id)` from `@mrrocket/sdk/next/server` (or the same HMAC in any\n * language). Needed when MRRocket › Settings › Products › Sign-in › \"Only signed users\" is on.\n */\n hash?: string;\n}\n\n/** The id the SDK holds a hash for, and the hash. */\nexport interface Signed {\n id: string;\n hash: string;\n}\n\n/** What to do when MRRocket refuses a request for want of a hash (once per page, in the console). Short: sdk.js has a size budget. */\nexport const UNSIGNED_HELP = \"401: sign the user id on your server with userHash(id) from @mrrocket/sdk/next/server and pass identify(id, props, { hash }).\";\n\n/** Says once per page (or app run) why MRRocket answered 401; other statuses say nothing. */\nexport const warnUnsigned = (status: number, log: (message: string) => void = (m) => console.warn(m)) => {\n const g = globalThis as { __mrrocketUnsigned?: boolean };\n if (status !== 401 || g.__mrrocketUnsigned) return;\n g.__mrrocketUnsigned = true;\n log(`[MRRocket] ${UNSIGNED_HELP}`);\n};\n\n/**\n * The signed id after `identify(id, …, { hash })`: a new hash replaces the old one, the same id without a hash keeps\n * the one it has, another id without a hash drops it. A hash that is not 64 hex characters (a typo, the server key\n * itself) is ignored with a warning instead of being sent.\n */\nexport const nextSigned = (signed: Signed | null, id: string, hash: unknown, log: (message: string) => void = (m) => console.warn(m)): Signed | null => {\n const h = typeof hash === \"string\" ? hash.trim().toLowerCase() : \"\";\n if (/^[0-9a-f]{64}$/.test(h)) return { id, hash: h };\n if (h) log(\"[MRRocket] identify: that hash is no userHash(id); not sent.\");\n return signed && signed.id === id ? signed : null;\n};\n\n/** The hash for `id`, when the SDK holds one for exactly that id. */\nexport const hashFor = (signed: Signed | null | undefined, id: string | undefined) => (signed && id && signed.id === id ? signed.hash : undefined);\n\n/**\n * The hash for a request that carries several items with their own ids (error reports): only when every item that\n * names someone names the signed id, so a report of an earlier visitor never goes out under this person's hash.\n */\nexport const hashForAll = (signed: Signed | null | undefined, ids: (string | undefined)[]) =>\n signed && ids.some((id) => id === signed.id) && ids.every((id) => !id || id === signed.id) ? signed.hash : undefined;\n"],"mappings":";AA6BO,IAAM,gBAAgB;AAGtB,IAAM,eAAe,CAAC,QAAgB,MAAiC,CAAC,MAAM,QAAQ,KAAK,CAAC,MAAM;AACrG,QAAM,IAAI;AACV,MAAI,WAAW,OAAO,EAAE,mBAAoB;AAC5C,IAAE,qBAAqB;AACvB,MAAI,cAAc,aAAa,EAAE;AACrC;AAOO,IAAM,aAAa,CAAC,QAAuB,IAAY,MAAe,MAAiC,CAAC,MAAM,QAAQ,KAAK,CAAC,MAAqB;AACpJ,QAAM,IAAI,OAAO,SAAS,WAAW,KAAK,KAAK,EAAE,YAAY,IAAI;AACjE,MAAI,iBAAiB,KAAK,CAAC,EAAG,QAAO,EAAE,IAAI,MAAM,EAAE;AACnD,MAAI,EAAG,KAAI,8DAA8D;AACzE,SAAO,UAAU,OAAO,OAAO,KAAK,SAAS;AACjD;AAGO,IAAM,UAAU,CAAC,QAAmC,OAA4B,UAAU,MAAM,OAAO,OAAO,KAAK,OAAO,OAAO;AAMjI,IAAM,aAAa,CAAC,QAAmC,QAC1D,UAAU,IAAI,KAAK,CAAC,OAAO,OAAO,OAAO,EAAE,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,OAAO,EAAE,IAAI,OAAO,OAAO;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { type ChangelogEntry, type ChatMessage, type ChatThread, type CockpitProviderProps, type CockpitUser, type FeedbackBoardInfo, type FeedbackBoardProps, type FeedbackComment, type FeedbackList, type FeedbackPost, type FeedbackRoadmap, type FeedbackWidgetProps, type MessengerProps, type PostStatus, type SurveyAnswer, type SurveyDefinition, type SurveyQuestion, type SurveyQuestionKind, CockpitProvider, Experiment, FeedbackBoard, FeedbackWidget, Messenger, Survey, Text, WIDGET_CSS, createApi, useCancelFlow, useCockpit, useFeedback, useFlag, useFlagVariant, useMessenger, usePaywall, usePush, useStyles, useVariant, } from "./browser.js";
2
2
  export type { PushResult, PushStatus, WebPushOptions } from "./push-web.js";
3
+ /** `identify(id, props, { hash })` (0.16.0); the hash comes from `userHash()` in `@mrrocket/sdk/next/server`. */
4
+ export type { IdentifyOptions } from "./identity.js";
3
5
  export { type CockpitConfig, type CockpitEvent, type ConsentChoice, type ConsentMode, type ReplayConfig, type ErrorReport, type ExperimentConfig, type FlagCondition, type FlagConditionSet, type FlagConfig, type FlagPerson, type RedirectConfig, type RedirectDecision, type VariantConfig, type VariantId, EMBED_PARAM, EXPOSURE_PARAM, SDK_VERSION, ID_COOKIE, PREVIEW_PARAM, SESSION_COOKIE, assign, evaluateFlag, parsePreview, previewHref, redirectFor, } from "./core.js";
4
6
  export { type CancelFlowConfig, type CancelFlowOptions, type CancelFlowResult, type CancelOffer, type InAppMessage, type OnboardingFlow, type OnboardingStep, } from "./flows.js";
5
7
  export type { FlowsTheme } from "./flows-ui.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type ChangelogEntry,\n type ChatMessage,\n type ChatThread,\n type CockpitProviderProps,\n type CockpitUser,\n type FeedbackBoardInfo,\n type FeedbackBoardProps,\n type FeedbackComment,\n type FeedbackList,\n type FeedbackPost,\n type FeedbackRoadmap,\n type FeedbackWidgetProps,\n type MessengerProps,\n type PostStatus,\n type SurveyAnswer,\n type SurveyDefinition,\n type SurveyQuestion,\n type SurveyQuestionKind,\n CockpitProvider,\n Experiment,\n FeedbackBoard,\n FeedbackWidget,\n Messenger,\n Survey,\n Text,\n WIDGET_CSS,\n createApi,\n useCancelFlow,\n useCockpit,\n useFeedback,\n useFlag,\n useFlagVariant,\n useMessenger,\n usePaywall,\n usePush,\n useStyles,\n useVariant,\n} from \"./browser\";\nexport type { PushResult, PushStatus, WebPushOptions } from \"./push-web\";\nexport {\n type CockpitConfig,\n type CockpitEvent,\n type ConsentChoice,\n type ConsentMode,\n type ReplayConfig,\n type ErrorReport,\n type ExperimentConfig,\n type FlagCondition,\n type FlagConditionSet,\n type FlagConfig,\n type FlagPerson,\n type RedirectConfig,\n type RedirectDecision,\n type VariantConfig,\n type VariantId,\n EMBED_PARAM,\n EXPOSURE_PARAM,\n SDK_VERSION,\n ID_COOKIE,\n PREVIEW_PARAM,\n SESSION_COOKIE,\n assign,\n evaluateFlag,\n parsePreview,\n previewHref,\n redirectFor,\n} from \"./core\";\nexport {\n type CancelFlowConfig,\n type CancelFlowOptions,\n type CancelFlowResult,\n type CancelOffer,\n type InAppMessage,\n type OnboardingFlow,\n type OnboardingStep,\n} from \"./flows\";\nexport type { FlowsTheme } from \"./flows-ui\";\nexport { PAYWALL_EVENT, type PaywallConfig, type PaywallOptions, type PaywallPage, type PaywallPlan, type PaywallResult } from \"./paywall\";\nexport {\n type AttributionMode,\n type CheckoutReferral,\n type Referral,\n REFERRAL_COOKIE,\n getReferral,\n readReferralCookie,\n referralForCheckout,\n referralLink,\n} from \"./referral\";\n"],"mappings":";AAAA;AAAA,EAmBI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP;AAAA,EAgBI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAWP,SAAS,qBAAsH;AAC/H;AAAA,EAII;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type ChangelogEntry,\n type ChatMessage,\n type ChatThread,\n type CockpitProviderProps,\n type CockpitUser,\n type FeedbackBoardInfo,\n type FeedbackBoardProps,\n type FeedbackComment,\n type FeedbackList,\n type FeedbackPost,\n type FeedbackRoadmap,\n type FeedbackWidgetProps,\n type MessengerProps,\n type PostStatus,\n type SurveyAnswer,\n type SurveyDefinition,\n type SurveyQuestion,\n type SurveyQuestionKind,\n CockpitProvider,\n Experiment,\n FeedbackBoard,\n FeedbackWidget,\n Messenger,\n Survey,\n Text,\n WIDGET_CSS,\n createApi,\n useCancelFlow,\n useCockpit,\n useFeedback,\n useFlag,\n useFlagVariant,\n useMessenger,\n usePaywall,\n usePush,\n useStyles,\n useVariant,\n} from \"./browser\";\nexport type { PushResult, PushStatus, WebPushOptions } from \"./push-web\";\n/** `identify(id, props, { hash })` (0.16.0); the hash comes from `userHash()` in `@mrrocket/sdk/next/server`. */\nexport type { IdentifyOptions } from \"./identity\";\nexport {\n type CockpitConfig,\n type CockpitEvent,\n type ConsentChoice,\n type ConsentMode,\n type ReplayConfig,\n type ErrorReport,\n type ExperimentConfig,\n type FlagCondition,\n type FlagConditionSet,\n type FlagConfig,\n type FlagPerson,\n type RedirectConfig,\n type RedirectDecision,\n type VariantConfig,\n type VariantId,\n EMBED_PARAM,\n EXPOSURE_PARAM,\n SDK_VERSION,\n ID_COOKIE,\n PREVIEW_PARAM,\n SESSION_COOKIE,\n assign,\n evaluateFlag,\n parsePreview,\n previewHref,\n redirectFor,\n} from \"./core\";\nexport {\n type CancelFlowConfig,\n type CancelFlowOptions,\n type CancelFlowResult,\n type CancelOffer,\n type InAppMessage,\n type OnboardingFlow,\n type OnboardingStep,\n} from \"./flows\";\nexport type { FlowsTheme } from \"./flows-ui\";\nexport { PAYWALL_EVENT, type PaywallConfig, type PaywallOptions, type PaywallPage, type PaywallPlan, type PaywallResult } from \"./paywall\";\nexport {\n type AttributionMode,\n type CheckoutReferral,\n type Referral,\n REFERRAL_COOKIE,\n getReferral,\n readReferralCookie,\n referralForCheckout,\n referralLink,\n} from \"./referral\";\n"],"mappings":";AAAA;AAAA,EAmBI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAIP;AAAA,EAgBI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAWP,SAAS,qBAAsH;AAC/H;AAAA,EAII;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;","names":[]}
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The web messenger, after Crisp's: a round launcher (hovered, a small card offers "Chat with us" and "Search") and a
3
- * panel with a bar on top (Home, a "Chat · Help" switch, a ⋮ menu to minimize or widen it). Home shows the greeting,
2
+ * The web messenger, after Crisp's: a round launcher (hovered, a small card offers "Chat" and "Search") and a panel
3
+ * with a bar on top (Home, a "Chat · Help" switch while there are both, a ⋮ menu to minimize or widen it). Home shows the greeting,
4
4
  * the latest chat and the help search; Chat is the chat with the team, answered in MRRocket › Support by the owner or
5
5
  * the Customer experience agent; Help lists the product's published help articles by collection, searchable, read in
6
6
  * the panel. While the panel is closed it checks for answers now and then; a new answer plays a short sound, shows a
@@ -11,7 +11,7 @@
11
11
  * dynamic import, and `sdk-messenger.js` for the script tag). Every text is set with textContent; articles arrive as
12
12
  * blocks, never HTML.
13
13
  */
14
- import { type Api } from "./api-client.js";
14
+ import { type Api, type MessengerCorners, type MessengerPosition } from "./api-client.js";
15
15
  export interface MessengerUiOptions {
16
16
  host: string;
17
17
  apiKey: string;
@@ -23,10 +23,13 @@ export interface MessengerUiOptions {
23
23
  name?: string;
24
24
  email?: string;
25
25
  } | undefined;
26
+ /** The identity hash of the visitor id now (0.16.0), when the site gave one to identify. */
27
+ userHash?: () => string | undefined;
26
28
  /** Show the round launcher (default true). Without it the panel opens only through `open()`. */
27
29
  launcher?: boolean;
28
- position?: "bottom-right" | "bottom-left";
29
- /** The panel's title. */
30
+ /** Where the launcher sits (default bottom right); the panel and the cards open from there. */
31
+ position?: MessengerPosition;
32
+ /** The team's name beside its mark on Home. */
30
33
  title?: string;
31
34
  /** The big line on Home and the first line of an empty chat. */
32
35
  greeting?: string;
@@ -44,6 +47,18 @@ export interface MessengerUiOptions {
44
47
  preview?: boolean;
45
48
  theme?: "light" | "dark" | "auto";
46
49
  accent?: string;
50
+ /** Up to two more colors blended with the accent in Home's background glow. */
51
+ glow?: string[];
52
+ /** How round panel, bubbles, cards and fields are (default round). */
53
+ corners?: MessengerCorners;
54
+ /** The site's own font (default) or the system's. */
55
+ font?: "site" | "system";
56
+ /** Home's top: plain (default) or in the accent color. */
57
+ header?: "plain" | "color";
58
+ /** "Powered by MRRocket" at the bottom; MRRocket's server says whether the plan may hide it. */
59
+ branding?: boolean;
60
+ /** The product's icon at the top left of Home (MRRocket sends the product's favicon); without it the title's first letter. */
61
+ logo?: string;
47
62
  /** MRRocket's own preview: mount inside this element (positioned) instead of the page. */
48
63
  container?: HTMLElement;
49
64
  /** MRRocket's own preview: answers from here instead of the server. */
@@ -52,7 +67,7 @@ export interface MessengerUiOptions {
52
67
  opened?: MessengerView;
53
68
  }
54
69
  /** What the messenger asks the server (createApi's part it uses). */
55
- export type MessengerClient = Pick<Api, "chat" | "sendChat" | "articles" | "article" | "rateArticle" | "messengerLook">;
70
+ export type MessengerClient = Pick<Api, "chat" | "sendChat" | "uploadChatFile" | "attachmentUrl" | "articles" | "article" | "rateArticle" | "messengerLook">;
56
71
  export type MessengerView = "home" | "messages" | "help";
57
72
  export interface MessengerHandle {
58
73
  /** Opens the panel, on Home or the given tab; `{ article }` opens a help article. */