Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions .github/workflows/build-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,28 @@ on:
pull_request:
push:
branches:
- master
- master

jobs:
Build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
cache: npm
- uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-


- run: npm install
- run: npm run prettier -- --check
- run: npm run lint
- run: npm run build
- run: npm run test
- run: npm run spellcheck
- run: npm install
- run: npm run prettier -- --check
- run: npm run lint
- run: npm run build
- run: npm run test
- run: npm run spellcheck
62 changes: 31 additions & 31 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,41 @@ on:
pull_request:
push:
branches:
- master
schedule:
- cron: "0 */6 * * *" # every 6 hours
- master
# schedule:
# - cron: "0 */6 * * *" # every 6 hours

jobs:
Tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
cache: npm
- uses: actions/cache@v3
with:
path: |
node_modules
~/.cache/Cypress
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v3
with:
path: cypress/application/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('cypress/application/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- uses: actions/cache@v4
with:
path: |
node_modules
~/.cache/Cypress
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v4
with:
path: cypress/application/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('cypress/application/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- run: npm install
- run: npm run test:build
- run: npm run test:integration
env:
CYPRESS_ENVIRONMENT: "${{ github.ref_name == 'master' && 'production' || 'staging' }}"
INTEGRATION_TEST_CLIENT_ID: ${{ secrets.INTEGRATION_TEST_CLIENT_ID }}
INTEGRATION_TEST_API_KEY: ${{ secrets.INTEGRATION_TEST_API_KEY }}
INTEGRATION_TEST_API_HOST: ${{ secrets.INTEGRATION_TEST_API_HOST }}
INTEGRATION_TEST_USER_GUID: ${{ secrets.INTEGRATION_TEST_USER_GUID }}
- run: npm install
- run: npm run test:build
- run: npm run test:integration
env:
CYPRESS_ENVIRONMENT: "${{ github.ref_name == 'master' && 'production' || 'staging' }}"
INTEGRATION_TEST_CLIENT_ID: ${{ secrets.INTEGRATION_TEST_CLIENT_ID }}
INTEGRATION_TEST_API_KEY: ${{ secrets.INTEGRATION_TEST_API_KEY }}
INTEGRATION_TEST_API_HOST: ${{ secrets.INTEGRATION_TEST_API_HOST }}
INTEGRATION_TEST_USER_GUID: ${{ secrets.INTEGRATION_TEST_USER_GUID }}
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.0.14] - 2025-08-01

### Added

- Support for `additional_product_option` in Connect Widget configuration.
- Support for `use_cases` in Connect Widget configuration.
- Support for `connections_use_case_filter` in Connections Widget configuration.

## [0.0.13] - 2024-3-11

### Changed

### Fixed
- @mxenabled/widget-post-message-definitions to v1.4.0

## [0.0.12] - 2024-2-12

Expand Down
30 changes: 29 additions & 1 deletion docs/widget_callback_props.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ const widget = widgetSdk.ConnectWidget({
- Payload fields:
- `user_guid` (`string`)
- `session_guid` (`string`)
- `context` (`string`)
- `context` (optional) (`string`)

<details>
<summary>Click here to view a sample usage of <code>onBackToSearch</code>.</summary>
Expand All @@ -434,3 +434,31 @@ const widget = widgetSdk.ConnectWidget({

</details>

---
### Invalid data (`mx/connect/invalidData`)

- Widget callback prop name: `onInvalidData`
- Payload fields:
- `user_guid` (`string`)
- `session_guid` (`string`)
- `member_guid` (`string`)
- `code` (`number`)

<details>
<summary>Click here to view a sample usage of <code>onInvalidData</code>.</summary>

```javascript
const widget = widgetSdk.ConnectWidget({
url: "https://widgets.moneydesktop.com/md/connect/...",

onInvalidData: (payload) => {
console.log(`User guid: ${payload.user_guid}`)
console.log(`Session guid: ${payload.session_guid}`)
console.log(`Member guid: ${payload.member_guid}`)
console.log(`Code: ${payload.code}`)
}
})
```

</details>

4 changes: 0 additions & 4 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
// language: "es",
// colorScheme: "dark",
// mode: "verification",
//
// Refer to https://docs.mx.com/connect/guides/sdk#react_native_widget_props and
// https://docs.mx.com/connect/guides/sdk#react_native_generating_the_widget_sso_url
// for information on all of the supported properties.

onMessage: (event) => {
logEvent(event.data)
Expand Down
16 changes: 15 additions & 1 deletion src/sso/widget_configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export type WidgetConfiguration = {

export type ConnectWidgetConfigurationProps = Camelize<ConnectWidgetConfiguration>
export type ConnectWidgetConfiguration = WidgetConfiguration & {
additional_product_option?: "account_verification" | "transactions"
client_redirect_url?: string
current_institution_code?: string
current_institution_guid?: string
Expand All @@ -73,14 +74,26 @@ export type ConnectWidgetConfiguration = WidgetConfiguration & {
include_transactions?: boolean
mode?: ConnectWidgetMode
update_credentials?: boolean
use_cases?: Array<"MONEY_MOVEMENT" | "PFM">
}

export type ConnectionsWidgetConfigurationProps = Camelize<ConnectionsWidgetConfiguration>
export type ConnectionsWidgetConfiguration = WidgetConfiguration & {
additional_product_option?: "account_verification" | "transactions"
connections_use_case_filter?: boolean
use_cases?: Array<"MONEY_MOVEMENT" | "PFM">
}

export function getWidgetConfigurationFromProps(
props: ConnectWidgetConfigurationProps & InternalWidgetConfigurationProps,
props: ConnectWidgetConfigurationProps &
InternalWidgetConfigurationProps &
ConnectionsWidgetConfigurationProps,
) {
return {
additional_product_option: props.additionalProductOption,
client_redirect_url: props.clientRedirectUrl,
color_scheme: props.colorScheme,
connections_use_case_filter: props.connectionsUseCaseFilter, // Connections specific
current_institution_code: props.currentInstitutionCode,
current_institution_guid: props.currentInstitutionGuid,
current_member_guid: props.currentMemberGuid,
Expand All @@ -92,6 +105,7 @@ export function getWidgetConfigurationFromProps(
ui_message_version: props.uiMessageVersion || 4,
ui_message_webview_url_scheme: props.uiMessageWebviewUrlScheme,
update_credentials: props.updateCredentials,
use_cases: props.useCases,
widget_type: props.widgetType,
}
}
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* DO NOT MODIFY
*/

export const sdkVersion = "0.0.11"
export const sdkVersion = "0.0.13"
10 changes: 8 additions & 2 deletions src/widgets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { getSsoUrl, Props as UrlLoadingProps, Type, ConnectWidgetConfigurationProps } from "./sso"
import {
getSsoUrl,
Props as UrlLoadingProps,
Type,
ConnectWidgetConfigurationProps,
ConnectionsWidgetConfigurationProps,
} from "./sso"
import { sdkVersion } from "./version"

import {
Expand Down Expand Up @@ -265,7 +271,7 @@ export class ConnectWidget extends Widget<
}
}

export class ConnectionsWidget extends Widget {
export class ConnectionsWidget extends Widget<ConnectionsWidgetConfigurationProps> {
get widgetType() {
return Type.ConnectionsWidget
}
Expand Down