Skip to content

Commit a11ae4b

Browse files
authored
Merge pull request #187 from moneytree/pr/LON-142-update-doc
[LON-142] [LON-78] Update Document
2 parents ea35fba + 1cf50ea commit a11ae4b

File tree

1 file changed

+32
-27
lines changed

1 file changed

+32
-27
lines changed

docs/README.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,38 @@ const newInstance = new window.MtLinkSdk();
2626
// e.g: const newInstance = new MtLinkSdk();
2727
```
2828

29-
### Typscript
29+
### `localStorage`
3030

31-
The source also includes Typescript definitions out of the box.
31+
Ensure your App enables access to `localStorage` otherwise magic link login will not work.
32+
Since `sessionStorage` is not shared between browser tabs.
3233

3334
### Polyfills
3435

3536
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.
3637

38+
### Typescript
39+
40+
The source also includes Typescript definitions out of the box.
41+
3742
## [API](types/classes/MtLinkSdk.html ':ignore')
3843

3944
The Moneytree LINK Javascript SDK exposes APIs to get guest consent to access financial data, and exchange an authorization grant for an access token.
4045

4146
The complete list of SDK functions is:
4247

43-
* [`init`](types/classes/MtLinkSdk.html#init ':ignore')
44-
* [`setSamlSubjectId`](types/classes/MtLinkSdk.html#setSamlSubjectId ':ignore')
45-
* [`authorize`](types/classes/MtLinkSdk.html#authorize ':ignore')
46-
* [`authorizeUrl`](types/classes/MtLinkSdk.html#authorizeUrl ':ignore')
47-
* [`onboard`](types/classes/MtLinkSdk.html#onboard ':ignore')
48-
* [`onboardUrl`](types/classes/MtLinkSdk.html#onboardUrl ':ignore')
49-
* [`exchangeToken`](types/classes/MtLinkSdk.html#exchangeToken ':ignore')
50-
* [`tokenInfo`](types/classes/MtLinkSdk.html#tokenInfo ':ignore')
51-
* [`logout`](types/classes/MtLinkSdk.html#logout ':ignore')
52-
* [`logoutUrl`](types/classes/MtLinkSdk.html#logoutUrl ':ignore')
53-
* [`openService`](types/classes/MtLinkSdk.html#openService ':ignore')
54-
* [`openServiceUrl`](types/classes/MtLinkSdk.html#openServiceUrl ':ignore')
55-
* [`requestLoginLink`](types/classes/MtLinkSdk.html#requestLoginLink ':ignore')
48+
- [`init`](types/classes/MtLinkSdk.html#init ':ignore')
49+
- [`setSamlSubjectId`](types/classes/MtLinkSdk.html#setSamlSubjectId ':ignore')
50+
- [`authorize`](types/classes/MtLinkSdk.html#authorize ':ignore')
51+
- [`authorizeUrl`](types/classes/MtLinkSdk.html#authorizeUrl ':ignore')
52+
- [`onboard`](types/classes/MtLinkSdk.html#onboard ':ignore')
53+
- [`onboardUrl`](types/classes/MtLinkSdk.html#onboardUrl ':ignore')
54+
- [`exchangeToken`](types/classes/MtLinkSdk.html#exchangeToken ':ignore')
55+
- [`tokenInfo`](types/classes/MtLinkSdk.html#tokenInfo ':ignore')
56+
- [`logout`](types/classes/MtLinkSdk.html#logout ':ignore')
57+
- [`logoutUrl`](types/classes/MtLinkSdk.html#logoutUrl ':ignore')
58+
- [`openService`](types/classes/MtLinkSdk.html#openService ':ignore')
59+
- [`openServiceUrl`](types/classes/MtLinkSdk.html#openServiceUrl ':ignore')
60+
- [`requestLoginLink`](types/classes/MtLinkSdk.html#requestLoginLink ':ignore')
5661

5762
Below are examples of common use cases.
5863

@@ -73,10 +78,10 @@ mtLinkSdk.init('my-client-id', {
7378
mtLinkSdk.authorize();
7479
// after redirect from moneytree back to your app's redirectUri
7580
const token = mtLinkSdk.exchangeToken();
76-
const tokenInfo = mtLinkSdk.tokenInfo(token.access_token)
81+
const tokenInfo = mtLinkSdk.tokenInfo(token.access_token);
7782
```
7883

79-
You can also use the [authorizeUrl](/types/classes/MtLinkSdk.html#authorizeUrl ':ignore') method to generate the authorization url without opening it immetiately.
84+
You can also use the [authorizeUrl](types/classes/MtLinkSdk.html#authorizeUrl ':ignore') method to generate the authorization url without opening it immediately.
8085

8186
### Passwordless Onboarding
8287

@@ -91,12 +96,12 @@ mtLinkSdk.init('my-client-id', {
9196
// Start onboarding flow for a new user
9297
// After the user completes onboarding this redirects with an authorization code
9398
// If a Monetyree user with this email already exists this prompts the user to login & grant consent (similar to authorize)
94-
mtLinkSdk.onboard({ email: '[email protected]'});
99+
mtLinkSdk.onboard({ email: '[email protected]' });
95100
// after redirect from moneytree back to your app's redirectUri
96101
const token = mtLinkSdk.exchangeToken();
97102
```
98103

99-
You can also use the [onboardUrl](/types/classes/MtLinkSdk.html#onboardUrl ':ignore') method to generate the onboard url without opening it immetiately.
104+
You can also use the [onboardUrl](types/classes/MtLinkSdk.html#onboardUrl ':ignore') method to generate the onboard url without opening it immediately.
100105

101106
### Logout
102107

@@ -113,12 +118,12 @@ mtLinkSdk.init('my-client-id', {
113118
mtLinkSdk.logout();
114119
```
115120

116-
You can also use the [logoutUrl](/types/classes/MtLinkSdk.html#logoutUrl ':ignore') method to generate the logout url without redirecting the user.
121+
You can also use the [logoutUrl](types/classes/MtLinkSdk.html#logoutUrl ':ignore') method to generate the logout url without redirecting the user.
117122

118123
### Open Services
119124

120-
With the [openService](/types/classes/MtLinkSdk.html#openService ':ignore') function you can open Moneytree services directly from your app.
121-
Alternatively, you can also use [openServiceUrl](/types/classes/MtLinkSdk.html#openServiceUrl ':ignore') to generate the url without opening it immetiately.
125+
With the [openService](types/classes/MtLinkSdk.html#openService ':ignore') function you can open Moneytree services directly from your app.
126+
Alternatively, you can also use [openServiceUrl](types/classes/MtLinkSdk.html#openServiceUrl ':ignore') to generate the url without opening it immediately.
122127

123128
#### Open Vault
124129

@@ -133,10 +138,10 @@ mtLinkSdk.init('my-client-id', {
133138
// Open Vault on the services list page
134139
// If the user is not logged in yet this will prompt them to login
135140
// If the user has not granted consent yet this will prompt them to grant consent
136-
mtLinkSdk.openService('vault', {view: 'services-list'});
141+
mtLinkSdk.openService('vault', { view: 'services-list' });
137142
```
138143

139-
Vault has serveral different views with different options for each, view the full documentation [here](/types/classes/MtLinkSdk.html#openService.openService-3 ':ignore').
144+
Vault has several different views with different options for each, view the full documentation [here](types/classes/MtLinkSdk.html#openService.openService-3 ':ignore').
140145

141146
#### Open MyAccount
142147

@@ -150,10 +155,10 @@ mtLinkSdk.init('my-client-id', {
150155
});
151156
// Open MyAccount on the settings page
152157
// If the user is not logged in yet this will prompt them to login
153-
mtLinkSdk.openService('myaccount', {view: 'settings'});
158+
mtLinkSdk.openService('myaccount', { view: 'settings' });
154159
```
155160

156-
MyAccount has serveral different views with different options for each, view the full documentation [here](/types/classes/MtLinkSdk.html#openService.openService-2 ':ignore').
161+
MyAccount has several different views with different options for each, view the full documentation [here](types/classes/MtLinkSdk.html#openService.openService-2 ':ignore').
157162

158163
### Set identifier for SSO login flow
159164

@@ -168,7 +173,7 @@ mtLinkSdk.init('my-client-id', {
168173
// this identifier will be passed back to your SAML Identity Provider in the SAML AuthnRequest
169174
mtLinkSdk.setSamlSubjectId('my-saml-subject-id');
170175
// Opens Vault, if the user is not logged in it will trigger the SAML SSO login flow and pass the SAML subject ID to the IdP
171-
mtLinkSdk.openService('vault', {view: 'services-list'});
176+
mtLinkSdk.openService('vault', { view: 'services-list' });
172177
```
173178

174179
## Theming

0 commit comments

Comments
 (0)