You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+26-6
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ const newInstance = new window.MtLinkSdk();
35
35
The source also includes Typescript definitions out of the box.
36
36
37
37
### Polyfills
38
+
38
39
We use [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) and [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) internally, if you wish to support old browsers (e.g: IE11), make sure to add the necessary polyfills.
39
40
40
41
## API
@@ -45,6 +46,7 @@ The Moneytree LINK Javascript SDK exposes APIs to get guest consent to access fi
45
46
46
47
The `init` call is used to initialize the SDK and set default options for API calls. Some LINK APIs can be used without calling `init`.<br /><br />
47
48
Calls related to OAuth require a client id which can only be set via the `init` function. These APIs include:
| clientId | string | true || <p>OAuth `clientId` of the app (please request this from your Moneytree representative if you need one).<p><p><strong>NOTE:</strong> This function will throw an error if this parameter isn't provided.</p> |
62
64
| <spanid="api-init_options">options</span> | object | false || <p>These options include all of the values below and also all `options` parameters of the other APIs. Options values passed here during initialization will be used by default if no options are passed when calling a specific API.</p><p>Available options are documented under [authorize options](#api-authorize_options) and [common options](#common-api-options); refer to each individual link for more details.</p> |
63
-
| options.mode |`production`, `staging`, `develop`, `local`| false |`production`| <p>Environment for the SDK to connect to, the SDK will connect to the Moneytree production server by default.<ul><li>Moneytree clients should use `staging` for development as `develop` may contain unstable features.</li><li>`local` should only be used for SDK development as it has local dependencies.</li></ul></p> |
65
+
| options.mode |`production`, `staging`, `develop`, `local`| false |`production`| <p>Environment for the SDK to connect to, the SDK will connect to the Moneytree production server by default.<ul><li>Moneytree clients should use `staging` for development as `develop` may contain unstable features.</li><li>`local` should only be used for SDK development as it has local dependencies.</li></ul></p> |
64
66
| options.locale | string | false | Auto detect. | Force Moneytree to load content in this specific locale. A default value will be auto detected based on guest langauges configurations and location if available. Check this [spec](https://www.w3.org/TR/html401/struct/dirlang.html#h-8.1.1) for more information.<br /><br />Currently supported values are:<br />`en`, `en-AU`, `ja`. |
65
67
| options.cobrandClientId (private) | string | false | | <strong>NOTE: This is an internal attribute. Please do not use it unless instructed by your integration representative.</strong><br /><br />Brand Moneytree apps with client's branding. E.g: logo or theme.
66
68
@@ -88,7 +90,7 @@ mtLinkSdk.authorize(options);
88
90
| options.codeChallenge | string | false || We only support SHA256 as code challenge method, therefore please ensure the `code_challenge` was generated using the SHA256 hash algorithm. [Click here](https://auth0.com/docs/api-auth/tutorials/authorization-code-grant-pkce) for more details.</p><strong>NOTE:</strong> Set this value only if your server wish to use PKCE flow. |
89
91
| options.pkce | boolean | false | false | Set to `true` if you wish to use PKCE flow on the client side, SDK will automatically generate the code challenge from a locally generated code verifier and use the code verifier in [exchangeToken](#exchangetoken). |
90
92
| <spanid="authorize_option_force_logout">options.forceLogout</span> | boolean | false |`false`| Force existing guest session to logout and call authorize with a clean state. |
91
-
| options.country |`AU`, `JP`| false | Value set during `init`. | Server location for the guest to login or sign up. If you wish to restrict your guest to only one country, make sure to set this value.<br /><br /><strong>NOTE:</strong> For apps created after 2020-07-08, the sign up form will display a country selection dropdown for the guest to select a country when this value is undefined or invalid. |
93
+
| options.country |`AU`, `JP`| false | Value set during `init`. | Server location for the guest to login or sign up. If you wish to restrict your guest to only one country, make sure to set this value.<br /><br /><strong>NOTE:</strong> For apps created after 2020-07-08, the sign up form will display a country selection dropdown for the guest to select a country when this value is undefined or invalid. |
92
94
93
95
### onboard
94
96
@@ -111,7 +113,7 @@ mtLinkSdk.onboard(options)
111
113
| Parameter | Type | Required | Default Value | Description |
112
114
| - | - | - | - | - |
113
115
| options | object | false | Value set during `init`. | Optional parameters.<br /><br />Most options are the same as the [authorize method](#authorize) options and [common options](#common-api-options) with a few exceptions.<br /><br />Unsupported options from [authorize](#authorize) and [common options](#common-api-options) are:<li>forceLogout</li><li>authAction</li><li>showAuthToggle</li><li>showRememberMe</li> |
114
-
| options.country |`AU`, `JP`| true | Value set during `init`. | Server location for the guest to login or sign up.<br /><br /><strong>NOTE:</strong> SDK will throw an error if both values here and from the [init options](?id=api-init_options) are undefined. |
116
+
| options.country |`AU`, `JP`| true | Value set during `init`. | Server location for the guest to login or sign up.<br /><br /><strong>NOTE:</strong> SDK will throw an error if both values here and from the [init options](?id=api-init_options) are undefined. |
115
117
| options.email | string | true | Value set during `init`. | A new Moneytree account will be created with this email address. If an existing account with this email exists, the guest will be redirected to the login screen.<br /><br /><strong>NOTE:</strong> SDK will throw an error if both values here and from the [init options](?id=api-init_options) are undefined. |
116
118
117
119
### exchangeToken
@@ -128,7 +130,6 @@ One way to use this API is by calling it in the script on your redirection page.
128
130
129
131
Alternatively, you can extract the `code` manually from the redirect URL and pass it to this function via the options object yourself.
| serviceId |`vault`, `myaccount-settings`, `link-kit`| true || Open a service by Id, current supported services are:<br /><li>`vault` - Manage your financial institution credentials.</li><li>`myaccount-settings` - Manage your Moneytree account settings.</li><li>`link-kit` - View all your financial data.<br /><br /><strong>NOTE:</strong> This function will throw an error if you do not specify a valid service ID. |
201
202
| options | object | false | Value set during `init`. | Optional parameters. Includes all options in [common options](#common-api-options). |
202
-
| options.view |`services-list`, `service-connection`, `connection-setting`, `customer-support`| false || We provide the way to open the Vault's specific pages. Please check the following sessions:<br /> <li>[Open Vault Services Page](#open-vault-services-page)</li><li>[Open Vault Service Connection Page](#open-vault-service-connection-page)</li><li>[Open Vault Service Setting Page](#open-vault-service-setting-page)</li><li>[Open Vault Customer Support Page](#open-vault-customer-support-page)</li> <br /><br /><strong>NOTE:</strong> The serviceId must be `vault` to enable this option.|
203
+
| options.view for Vault |`services-list`, `service-connection`, `connection-setting`, `customer-support`| false || We provide options for opening a specific page on Vault and MyAccount. Please check the following sessions:<br /> <li>[Open Vault Services Page](#open-vault-services-page)</li><li>[Open Vault Service Connection Page](#open-vault-service-connection-page)</li><li>[Open Vault Service Setting Page](#open-vault-service-setting-page)</li><li>[Open Vault Customer Support Page](#open-vault-customer-support-page)</li><br /><br /><strong>NOTE:</strong> The serviceId must be `vault` to enable this option.|
204
+
| options.view for MyAccount |`authorized-applications`, `change-language`, `email-preferences`, `delete-account`, `update-email`, `update-password`| false || We provide options for opening a specific page on MyAccount. Please check the following sessions:<br /> <li>[Open MyAccount Page](#open-myaccount-page)</li> <br /><br /><strong>NOTE:</strong> The serviceId must be `myaccount-settings` to enable this option.|
| Parameter | Type | Required | Default Value | Description |
292
+
| - | - | - | - | - |
293
+
| serviceId |`myaccount-settings`| true || Open MyAccount |
294
+
| options.view |`authorized-applications`, `change-language`, `email-preferences`, `delete-account`, `update-email`, `update-password`| false || Directly go to the chosen page. If no view is provided, it goes to the top page of MyAccount. |
295
+
277
296
### requestMagicLink
278
297
279
298
Request for a magic link (password-less login link) to be sent to the guest's email address. Clicking on the link in the email will log a guest in directly to the screen specified by the `magicLinkTo` parameter.
@@ -300,7 +319,7 @@ These common options are used in multiple APIs. Instead of repeating the same op
300
319
| - | - | - | - | - |
301
320
| options.email | string | false | Value set during `init`. | Email used to pre-fill the email field in login or sign up or form. |
302
321
| options.backTo | string | false | Value set during `init`. | A redirection URL for redirecting a guest back to in the following condition: <li>Guest clicks on `Back to [App Name]` button in any Moneytree screen.</li><li>Guest refuses to give consent to access permission in the consent screen.</li><li>Guest logs out from Moneytree via an app with this client id</li><li>Revoke an app's consent from settings screen opened via an app with this client id</li><br /><br /><strong>NOTE:</strong> No `Back to [App Name]` button will be shown if this value is not set, and any of the actions mentioned above will redirect the guest back to login screen by default. |
303
-
| <spanid="authorize_option_auth_action">options.authAction</span> |`login`, `signup`| false | Value set during `init`.<p><strong>OR</strong></p>`login`| Show login or sign up screen when a session does not exist during an `authorize` call. |
322
+
| <spanid="authorize_option_auth_action">options.authAction</span> |`login`, `signup`| false | Value set during `init`.<p><strong>OR</strong></p>`login`| Show login or sign up screen when a session does not exist during an `authorize` call. |
304
323
| options.showAuthToggle | boolean | false | Value set during `init`.<p><strong>OR</strong></p>`true` | If you wish to disable the login to sign up form toggle button and vice-versa in the auth screen, set this to `false`.
305
324
| options.showRememberMe | boolean | false | Value set during `init`.<p><strong>OR</strong></p>`true` | If you wish to disable the `Stay logged in for 30 days` checkbox in the login screen, set this to `false`.
306
325
| options.isNewTab | boolean | false | Value set during `init`.<p><strong>OR</strong></p>`false` | Call method and open/render in a new browser tab, by default all views open in the same tab.
@@ -312,6 +331,7 @@ These common options are used in multiple APIs. Instead of repeating the same op
312
331
We support gray labelling some of the services offered by Moneytree, please contact your Moneytree representative for more information.
0 commit comments