Skip to content

Commit 3f56549

Browse files
authored
Merge pull request #55 from moneytree/AK-402
[AKL-402] Sample App
2 parents 1a55579 + 89edfcf commit 3f56549

File tree

9 files changed

+4687
-1
lines changed

9 files changed

+4687
-1
lines changed

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ You can validate a token or get guest or resource server information related to
149149
<h6>Usage:</h6>
150150

151151
```javascript
152-
const tokenInfo = await mtLinkSdk.tokenInfo(token, options);
152+
const tokenInfo = await mtLinkSdk.tokenInfo(token);
153153
tokenInfo.iat // token creation timestamp,
154154
tokenInfo.exp // token expiration timestamp,
155155
tokenInfo.sub // guest uid or null,

sample/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Moneytree JS SDK Example
2+
3+
An example of the Moneytree JS SDK.
4+
5+
## Install
6+
7+
---
8+
9+
`yarn install`
10+
11+
## Usage
12+
13+
---
14+
15+
`yarn start`

sample/package.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "mt-link-javascript-sdk-sample",
3+
"version": "2.0.0",
4+
"author": "Moneytree",
5+
"description": "An example of the Moneytree Web SDK.",
6+
"license": "MIT",
7+
"main": "./src/index.ts",
8+
"scripts": {
9+
"start": "webpack serve"
10+
},
11+
"dependencies": {
12+
"@moneytree/mt-link-javascript-sdk": "file:../"
13+
},
14+
"devDependencies": {
15+
"html-webpack-plugin": "^4.5.0",
16+
"url-safe-base64": "^1.1.1",
17+
"webpack": "^5.1.0",
18+
"webpack-cli": "^4.2.0",
19+
"webpack-dev-server": "^3.11.0"
20+
},
21+
"engines": {
22+
"node": ">=12"
23+
}
24+
}

sample/src/elements.ts

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
export default {
2+
commonOptionsElms: {
3+
email: document.getElementById('common-options-email') as HTMLInputElement,
4+
backTo: document.getElementById('common-options-backTo') as HTMLInputElement,
5+
authAction: document.getElementById('common-options-authAction') as HTMLSelectElement,
6+
showAuthToggle: document.getElementById('common-options-showAuthToggle') as HTMLInputElement,
7+
showRememberMe: document.getElementById('common-options-showRememberMe') as HTMLInputElement,
8+
isNewTab: document.getElementById('common-options-isNewTab') as HTMLInputElement,
9+
},
10+
authorizeOptionsElms: {
11+
scopes: document.getElementById('authorize-options-scopes') as HTMLSelectElement,
12+
},
13+
onboardOptionsElms: {
14+
email: document.getElementById('onboard-options-email') as HTMLSelectElement,
15+
scopes: document.getElementById('onboard-options-scopes') as HTMLSelectElement,
16+
country: document.getElementById('onboard-options-country') as HTMLSelectElement,
17+
},
18+
openServiceOptionsElms: {
19+
serviceId: document.getElementById('open-service-options-serviceId') as HTMLSelectElement,
20+
view: document.getElementById('open-service-options-view') as HTMLSelectElement,
21+
type: document.getElementById('open-service-options-type') as HTMLSelectElement,
22+
group: document.getElementById('open-service-options-group') as HTMLSelectElement,
23+
search: document.getElementById('open-service-options-search') as HTMLInputElement,
24+
entityKey: document.getElementById('open-service-options-entityKey') as HTMLInputElement,
25+
credentialId: document.getElementById('open-service-options-credentialId') as HTMLInputElement,
26+
},
27+
initializeBtn: document.getElementById('initialize-btn') as HTMLButtonElement,
28+
authorizeBtn: document.getElementById('authorize-btn') as HTMLButtonElement,
29+
logoutBtn: document.getElementById('logout-btn') as HTMLButtonElement,
30+
openServiceBtn: document.getElementById('open-service-btn') as HTMLButtonElement,
31+
tokenInfoBtn: document.getElementById('token-info-btn') as HTMLButtonElement,
32+
sendMagicLinkBtn: document.getElementById('send-magic-link') as HTMLButtonElement,
33+
doOnboardBtn: document.getElementById('do-onboard') as HTMLButtonElement,
34+
tokenElm: document.getElementById('token') as HTMLInputElement,
35+
magicLinkToElm: document.getElementById('magicLinkTo') as HTMLSelectElement,
36+
magicLinkEmailElm: document.getElementById('magicLink-email') as HTMLSelectElement,
37+
tokenInfoLabel: document.getElementById('token-info-text') as HTMLInputElement,
38+
accessTokenLabel: document.getElementById('access-token-text') as HTMLParagraphElement,
39+
authorizationSection: document.getElementById('authorization-section') as HTMLDivElement,
40+
onBoardSection: document.getElementById('onboard-section') as HTMLDivElement,
41+
magicLinkSection: document.getElementById('magic-link-section') as HTMLDivElement,
42+
openServiceSection: document.getElementById('open-service-section') as HTMLDivElement,
43+
logoutSection: document.getElementById('logout-section') as HTMLDivElement,
44+
tokenInfoSection: document.getElementById('token-info-section') as HTMLDivElement,
45+
vaultOptions: document.getElementById('vault-options') as HTMLDivElement,
46+
};

0 commit comments

Comments
 (0)