@melio-eng/web-sdk 1.0.40 → 1.1.0-pr.92.a38482a

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.
package/README.md CHANGED
@@ -135,6 +135,25 @@ Host Melio account settings within your product.
135
135
  melioSDK.openSettings(config: SettingsConfig): FlowInstance
136
136
  ```
137
137
 
138
+ #### Entry Point (`entryPoint`)
139
+
140
+ `PayFlowConfig`, `JustPayFlowConfig` and `OnboardingConfig` accept an optional `entryPoint` — which
141
+ page of your product the user came from. Melio uses it to word the button that ends the flow:
142
+
143
+ | `entryPoint` | return button reads |
144
+ |---|---|
145
+ | `"bills"` | "Back to bills" |
146
+ | `"contacts"` | "Back to contacts" |
147
+ | `"quickpayment"` | "Back to quick payment" |
148
+ | `"managepayments"` | "Back to manage payments" |
149
+ | `"home"` | "Back to homepage" |
150
+ | `"generic"` | "Finish and return" |
151
+ | _omitted_ | today's default wording |
152
+
153
+ It's wording only — the `completed` event carries no destination, so your app still handles
154
+ navigation. On the Pay Flow, it has no effect when `billIdType` is `"melio"`. See
155
+ [Entry point](./guides/pay-flow-integration.md#entry-point) in the full guide for a worked example.
156
+
138
157
  ### Event Handling
139
158
 
140
159
  Each flow method returns a `FlowInstance` that allows you to register event listeners:
package/dist/types.d.ts CHANGED
@@ -42,10 +42,26 @@ export interface UserDetails {
42
42
  dateOfBirth?: string;
43
43
  }
44
44
  /**
45
- * Entry point context for the flow, used to construct the externalOrigin parameter.
46
- * When provided, the externalOrigin becomes `${partnerName}-${entryPoint}` (e.g., 'your-partner-name-contacts').
47
- */
48
- export type ExternalEntryPoint = 'contacts';
45
+ * Which page of your product the user came from. Melio uses it to word the button that
46
+ * ends the flow:
47
+ *
48
+ * | `entryPoint` | return button reads |
49
+ * | --- | --- |
50
+ * | `'bills'` | "Back to bills" |
51
+ * | `'contacts'` | "Back to contacts" |
52
+ * | `'quickpayment'` | "Back to quick payment" |
53
+ * | `'managepayments'` | "Back to manage payments" |
54
+ * | `'home'` | "Back to homepage" |
55
+ * | `'generic'` | "Finish and return" |
56
+ *
57
+ * Use `'generic'` when your page has no single destination; omit `entryPoint` for the
58
+ * default wording.
59
+ *
60
+ * @remarks
61
+ * Wording only — it does not navigate. The `completed` event carries no destination, so your
62
+ * application still decides where the click lands.
63
+ */
64
+ export type ExternalEntryPoint = 'bills' | 'contacts' | 'quickpayment' | 'managepayments' | 'home' | 'generic';
49
65
  /**
50
66
  * Configuration for onboarding flow
51
67
  */
@@ -53,7 +69,7 @@ export interface OnboardingConfig extends BaseFlowConfig {
53
69
  userDetails?: UserDetails;
54
70
  organizationDetails?: OrganizationDetails;
55
71
  enforceOnboarding?: boolean;
56
- /** Optional entry point context — affects the externalOrigin passed to the platform */
72
+ /** Which page of your product the user came from; words the button that ends the flow. See {@link ExternalEntryPoint}. */
57
73
  entryPoint?: ExternalEntryPoint;
58
74
  }
59
75
  /**
@@ -61,7 +77,10 @@ export interface OnboardingConfig extends BaseFlowConfig {
61
77
  */
62
78
  export interface PayFlowConfig extends BaseFlowConfig {
63
79
  billIds: Array<string>;
64
- /** Optional entry point context — affects the externalOrigin passed to the platform */
80
+ /**
81
+ * Which page of your product the user came from; words the button that ends the flow.
82
+ * Has no effect when `billIdType` is `'melio'`. See {@link ExternalEntryPoint}.
83
+ */
65
84
  entryPoint?: ExternalEntryPoint;
66
85
  /**
67
86
  * How the platform should resolve the provided `billIds`. Defaults to `'accounting'`.
@@ -82,7 +101,7 @@ export interface JustPayFlowConfig extends BaseFlowConfig {
82
101
  externalVendorIds: Array<string>;
83
102
  /** Optional amount to prefill in the payment flow */
84
103
  amount?: number;
85
- /** Optional entry point context — affects the externalOrigin passed to the platform */
104
+ /** Which page of your product the user came from; words the button that ends the flow. See {@link ExternalEntryPoint}. */
86
105
  entryPoint?: ExternalEntryPoint;
87
106
  }
88
107
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melio-eng/web-sdk",
3
- "version": "1.0.40",
3
+ "version": "1.1.0-pr.92.a38482a",
4
4
  "description": "Melio Web SDK - Embed core Melio workflows directly into partner UI with minimal effort",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",