{"id":20596975,"url":"https://github.com/tradle/tradleconf","last_synced_at":"2026-03-11T17:03:17.348Z","repository":{"id":27529389,"uuid":"114273670","full_name":"tradle/tradleconf","owner":"tradle","description":"CLI for managing your Tradle MyCloud instance","archived":false,"fork":false,"pushed_at":"2025-01-21T19:09:32.000Z","size":3528,"stargazers_count":5,"open_issues_count":9,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-03T16:36:57.075Z","etag":null,"topics":["blockchain","bot","chatbot","kyc","mycloud","serverless","tradle","tradle-mycloud"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tradle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-14T16:35:48.000Z","updated_at":"2025-01-21T19:09:36.000Z","dependencies_parsed_at":"2024-11-16T08:19:56.904Z","dependency_job_id":"1ca2d993-7caf-4832-b96b-200d33659a40","html_url":"https://github.com/tradle/tradleconf","commit_stats":null,"previous_names":["tradle/configure-tradle"],"tags_count":100,"template":false,"template_full_name":null,"purl":"pkg:github/tradle/tradleconf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ftradleconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ftradleconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ftradleconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ftradleconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tradle","download_url":"https://codeload.github.com/tradle/tradleconf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ftradleconf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268596672,"owners_count":24275928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","bot","chatbot","kyc","mycloud","serverless","tradle","tradle-mycloud"],"created_at":"2024-11-16T08:19:44.452Z","updated_at":"2026-03-11T17:03:17.277Z","avatar_url":"https://github.com/tradle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @tradle/conf\n\nCLI for managing your Tradle MyCloud instance\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Prerequisites](#prerequisites)\n  - [AWS Account](#aws-account)\n  - [Launch a MyCloud instance](#launch-a-mycloud-instance)\n  - [AWS cli \u0026 credentials](#aws-cli--credentials)\n  - [AWSLogs (optional)](#awslogs-optional)\n- [Docker](#docker)\n- [Install and load current configuration](#install-and-load-current-configuration)\n- [Updating tradleconf](#updating-tradleconf)\n- [Customize](#customize)\n  - [Custom Models and Lenses](#custom-models-and-lenses)\n  - [Custom Styles](#custom-styles)\n  - [Custom Bot Configuration (and plugins)](#custom-bot-configuration-and-plugins)\n  - [Custom Terms and Conditions](#custom-terms-and-conditions)\n  - [Custom KYC Services](#custom-kyc-services)\n- [Deploy](#deploy)\n  - [To your local development environment](#to-your-local-development-environment)\n  - [To the cloud](#to-the-cloud)\n- [Updating MyCloud](#updating-mycloud)\n  - [MyCloud Release Schedule](#mycloud-release-schedule)\n- [Destroy](#destroy)\n- [Restore](#restore)\n- [Logging](#logging)\n- [Common Commands](#common-commands)\n  - [Get web/mobile app links, deployment info, blockchain address](#get-webmobile-app-links-deployment-info-blockchain-address)\n  - [Load remote models, styles and configuration](#load-remote-models-styles-and-configuration)\n  - [Push bot/plugins configuration](#push-botplugins-configuration)\n  - [Set admin email for alerts](#set-admin-email-for-alerts)\n  - [Change database autoscaling](#change-database-autoscaling)\n  - [Disable MyCloud](#disable-mycloud)\n  - [Set days before logs transition to Amazon Glacier](#set-days-before-logs-transition-to-amazon-glacier)\n  - [Set days before logs are deleted permanently](#set-days-before-logs-are-deleted-permanently)\n- [Blockchain](#blockchain)\n  - [Balance](#balance)\n  - [Sealing Mode](#sealing-mode)\n- [Alerts](#alerts)\n- [Built-in Plugins](#built-in-plugins)\n  - [Terms and Conditions](#terms-and-conditions)\n  - [Lens](#lens)\n  - [Prefill form](#prefill-form)\n  - [ComplyAdvantage](#complyadvantage)\n  - [OpenCorporates](#opencorporates)\n  - [Onfido](#onfido)\n  - [Centrix](#centrix)\n  - [Document Checker](#document-checker)\n  - [TrueFace](#trueface)\n  - [RankOne](#rankone)\n  - [FacialRecognition](#facialrecognition)\n  - [DocumentValidity](#documentvalidity)\n  - [Customize message](#customize-message)\n  - [Webhooks](#webhooks)\n  - [Deployment](#deployment)\n  - [Conditional auto-approve](#conditional-auto-approve)\n  - [Sme onboarding](#sme-onboarding)\n  - [Sme auto-approve](#sme-auto-approve)\n  - [Data Import / Remediation](#data-import--remediation)\n  - [Required Forms](#required-forms)\n  - [Controlling person registration](#controlling-person-registration)\n  - [Controlling entity validation](#controlling-entity-validation)\n  - [Verify Phone Number](#verify-phone-number)\n  - [Prefill Beneficial Owners](#prefill-controllingPerson)\n  - [Modification History](#client-edits)\n  - [Inter-Form conditionals](#interFormConditionals)\n- [Troubleshooting](#troubleshooting)\n  - [tradleconf update](#tradleconf-update)\n  - [tradleconf enable-kyc-services](#tradleconf-enable-kyc-services)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n### Prerequisites\n\n#### AWS Account\n\n*Note: optional if you only plan on running MyCloud in development mode on your machine.*\n\nIf you don't have one yet, get one. There's a pretty generous free tier.\n\n#### Launch a MyCloud instance\n\n*Note: optional if you only plan on running MyCloud in development mode on your machine.*\n\nClick [here](https://app.tradle.io/#/applyForProduct?provider=9658992cbb1499c1fd9f7d92e1dee43eb65f403b3a32f2d888d2f241c4bdf7b6\u0026host=https%3A%2F%2Ft22ju1ga5c.execute-api.us-east-1.amazonaws.com%2Fdev\u0026product=tradle.cloud.Deployment). You'll be prompted to fill out a MyCloud configuration form. When you do, you'll be given a launch link. Follow it to launch your MyCloud in AWS.\n\nWhile you wait, read on.\n\n*Note: currently, the following regions are supported: US East (Virginia), Asia Pacific (Singapore), or Asia Pacific (Sydney). If you need to launch in a different region, please submit an issue on this repository. For most, we can provision support at a moment's notice.*\n\n#### AWS cli \u0026 credentials\n\n1. [Install](http://docs.aws.amazon.com/cli/latest/userguide/installing.html)\n1. create a new IAM user with AdministratorAccess\n1. Configure your credentials: `aws configure` or `aws configure --profile \u003cprofileName\u003e`. This will set up your AWS credentials in `~/.aws/`\n\n#### AWSLogs (optional)\n\nIf you want to inspect logs from your lambda functions in realtime, you'll need to install [awslogs](https://github.com/jorgebastida/awslogs), as the command `tradleconf log` uses awslogs underneath.\n\n### Docker\n\nTo use tradleconf via docker, you can add the following function to your `~/.bash_profile`:\n\n```sh\ntradleconf() {\n  docker pull tradle/conf\n  docker run --rm -v $HOME/.aws:/root/.aws -v $(pwd):/app/conf tradle/conf:latest $@\n}\n```\n\nThen use the `tradleconf` command in your shell as described below\n\n### Install and load current configuration\n\nNote: the below instructions are for managing a single MyCloud instance.\n\n1. Install `tradleconf` globally: `npm install -g @tradle/conf` (you may need `sudo` depending on how you installed Node.js)\n1. Create a new directory in which you will keep your configuration. In it, initialize your configuration with `tradleconf init`. This will create a file called `.env`\n1. Pull your remote configuration in with `tradleconf load --all`. Or pull in a specific part of it, e.g.:\n\n`tradleconf load --models`\n`tradleconf load --style`\n`tradleconf load --bot`\n`tradleconf load --terms`\n\n### Updating tradleconf\n\nTry to use the latest version of `tradleconf` at all times. `tradleconf` checks for updates as you use it, but at any time, you can update it yourself in the same way you installed it (see the [Install](#install-and-load-current-configuration) section)\n\n### Customize\n\nThe following sections are optional, e.g. if you don't have Custom Models, skip the custom models section. If you don't have custom styles, skip the Custom Styles section, etc.\n\n#### Custom Models and Lenses\n\nSee sample custom models in `./models-sample`. You can create your own in `./models` and lenses in `./lenses`. Put each model in a separate json file where the file name is [yourModel.id].json. See [./models-sample/my.custom.NameForm.json](./models-sample/my.custom.NameForm.json) and [./lenses-sample/my.custom.lens.PersonalInfo.json](./lenses-sample/my.custom.lens.PersonalInfo.json) for examples\n\n#### Custom Styles\n\nDefine your provider's style in `./conf/style.json` (see [./conf/style.sample.json](./conf/style.sample.json)). Style must adhere to the [StylesPack](https://github.com/tradle/models/tree/master/models/tradle.StylesPack.json) model.\n\nSee more details and screenshots for styles [here](https://github.com/tradle/tradleconf/blob/master/docs/style.md)\n\n#### Custom Bot Configuration (and plugins)\n\nSet your bot's configuration in `./conf/bot.json`. See [./conf/bot.sample.json](./conf/bot.sample.json) for an example. Also, see the [Plugins](#built-in-plugins) section for how to configure the currently available plugins.\n\n#### Custom Terms and Conditions\n\nIf you have Terms and Conditions you want your customers to accept prior to interacting with your bot, add them in `./conf/terms-and-conditions.md` (see [./conf/terms-and-conditions.sample.md](./conf/terms-and-conditions.sample.md))\n\nYou will also need to add a block in the `plugins` block in `conf/bot.json` to enable/disable the T's and C's. See the [plugin configuration](#terms-\u0026-conditions) below.\n\n#### Custom KYC Services\n\nSeveral of the services Tradle pre-integrates with need to be enabled explicitly before use, and are launched in a separate AWS cloudformation stack.\n\nTo enable/update them, run:\n\n`tradleconf enable-kyc-services`\n\nAfter the command completes (~20 minutes), you'll be able to configure the respective plugins\n\nTo specify which kyc services to enable, run:\n\n`tradleconf set-kyc-services --name1 --name2` (run `tradleconf set-kyc-services --help` to see what's available)\n\nTo delete your kyc-services stack (it's stateless, so you can always create a new one):\n\n`tradleconf disable-kyc-services`\n\nFor developers: adding a new service option can be tracked in git history for changes made at 2020-04-05 for idrnd-liveface\n\n### Deploy\n\nYou can deploy your configuration to your local Tradle development environment running on your machine, or to your Tradle MyCloud running in AWS.\n\n#### To your local development environment\n\n`tradleconf deploy --local --all`\n\nOr if you only want to deploy a particular item:\n\n- models: `tradleconf deploy --local --models`\n- styles: `tradleconf deploy --local --style`\n- bot configuration: `tradleconf deploy --local --bot`\n- terms and conditions: `tradleconf deploy --local --terms`\n\n#### To the cloud\n\nSame as above, minus the `--local` flag. You will be asked for confirmation unless you add the `--remote` flag.\n\n### Updating MyCloud\n\nSee [docs/updates.md](docs/updates.md)\n\n#### MyCloud Release Schedule\n\nReleases follow [semver](http://semver.org). A version like `1.9.4` represents `MAJOR.MINOR.PATCH` or in other words `MAJOR.FEATURE.BUGFIX`. For example:\n\n- `1.1.7 -\u003e 1.1.8` is bug fix release\n- `1.1.7 -\u003e 1.2.0` is a feature release\n\nIn between releases, there are release candidates, which are experimental pre-releases of bugfixes or features for those who like to live on the bleeding edge.\n\nRelease candidates end with `-rc.X`, e.g. `1.9.0-rc.1000`\n\nRelease candidates come *before* the version they're a candidate for:\n\n```\n1.9.0 -\u003e 1.9.0-rc.1000\n1.9.1-rc.0 -\u003e 1.9.1\n1.9.1-rc.20 -\u003e 1.9.1\n```\n\nA sample timeline goes like this, with releases in bold:\n\n```sh\n1.8.3       # BUGFIX RELEASE\n1.9.0-rc.0  # pre-release new feature\n1.9.0-rc.1  # pre-release bugfix\n1.9.0-rc.2  # pre-release another bugfix\n#           # ...\n1.9.0-rc.7  # bugs fixed, new feature stabilized, ready for release\n1.9.0       # REGULAR FEATURE RELEASE\n1.9.1-rc.0  # pre-release bugfix\n1.9.1       # REGULAR BUGFIX RELEASE\n#           # ...\n1.9.13\n1.10.0-rc.0 # pre-release new feature\n1.10.0-rc.1 # pre-release bugfix\n1.10.1      # REGULAR BUGFIX RELEASE\n# ...\n```\n\n### Destroy\n\nIf murder is in your heart, you can destroy your Tradle MyCloud irreversibly using `tradleconf destroy`\n\n### Restore\n\nFor whatever reasons, sometimes you may want to restore a failed or corrupted stack, and even restore your data to a point in time. See the [Restore](./restore.md) documentation.\n\n### Logging\n\n```sh\ntradleconf log onmessage -s 5m # log onmessage since 5m ago\ntradleconf tail onmessage -s 5m # log onmessage since 5m ago, tail\ntradleconf log -s 5m # log some function (you'll get a chooser prompt)\ntradleconf log --help # get additional tips\n```\n\n### Common Commands\n\n#### Get web/mobile app links, deployment info, blockchain address\n\n`tradleconf info --remote`\n\nsample response:\n\n```json\n{\n  \"links\": {\n    \"result\": {\n      \"mobile\": \"https://link.tradle.io/chat?provider=569a4dc1fc69f6137dede81ca0ff77c1a5feb0f4a7bdc73e0007f5ed3a1d1f60\u0026host=https%3A%2F%2Ftv5n42vd5f.execute-api.us-east-1.amazonaws.com%2Fdev\",\n      \"web\": \"https://app.tradle.io/#/chat?provider=569a4dc1fc69f6137dede81ca0ff77c1a5feb0f4a7bdc73e0007f5ed3a1d1f60\u0026host=https%3A%2F%2Ftv5n42vd5f.execute-api.us-east-1.amazonaws.com%2Fdev\",\n      \"employeeOnboarding\": \"https://app.tradle.io/#/applyForProduct?provider=569a4dc1fc69f6137dede81ca0ff77c1a5feb0f4a7bdc73e0007f5ed3a1d1f60\u0026host=https%3A%2F%2Ftv5n42vd5f.execute-api.us-east-1.amazonaws.com%2Fdev\u0026product=tradle.EmployeeOnboarding\"\n    }\n  },\n  \"version\": {\n    \"commit\": \"c403d33\",\n    \"version\": \"1.0.0\",\n    \"branch\": \"master\"\n  },\n  \"chainKey\": {\n    \"type\": \"ethereum\",\n    \"pub\": \"04d7ad3d714dac85ee6f91381eeb688c0d8766c274400a4ecae6a29896ee83e4221f880fc0d2bc6adc0647c043e0683daada1d2ccf7a9e3e7170400ed63b69e7fa\",\n    \"fingerprint\": \"fe134e1332f37b8bb8df74c0aa60c2d4b3e6e1f4\",\n    \"networkName\": \"rinkeby\"\n  },\n  \"apiBaseUrl\": \"https://tv5n42vd5f.execute-api.us-east-1.amazonaws.com/dev\"\n}\n```\n\n#### Load remote models, styles and configuration\n\n`tradleconf load --remote`\n\n#### Push bot/plugins configuration\n\n`tradleconf deploy --remote --bot`\n\n#### Set admin email for alerts\n\n`tradleconf set-admin-email --email \u003cemail\u003e`\n\n#### Change database autoscaling\n\nCommand to let you change to the new on-demand autoscaling:\n\n`tradleconf set-db-autoscaling --on-demand`\n\n*Note: changing to on-demand autoscaling is a strictly throttled DB configuration operation*\n\nto revert:\n\n`tradleconf set-db-autoscaling --provisioned`\n\n#### Disable MyCloud\n\nIf for some reason or other, you need to disable your deployment temporarily, you can run:\n\n`tradleconf disable --remote`\n\nThis will turn most of your cloud functions off. Mobile/web clients will be unable to reach your MyCloud.\n\nTo re-enable your deployment:\n- go to the AWS lambda console\n- find xxx-cli lambda\n- remove **DISABLED** from this lambda **Environment variables**\n- Save the changes\n- Run:\n\n`tradleconf enable --remote`\n\n#### Set days before logs transition to Amazon Glacier\n\n`tradleconf set-logs-transition --days \u003cdays\u003e`\n\n#### Set days before logs are deleted permanently\n\n`tradleconf set-logs-ttl --days \u003cdays\u003e`\n\n### Blockchain\n\n#### Balance\n\nTo check your address and balance, you can use the `balance` command, e.g.:\n\n`tradleconf balance --remote`\n\nTo top up, send funds to that address. Make sure you're sending funds on the right blockchain network!\n\nFunds are typically specified in the lowest unit of the particular blockchain, e.g. in satoshis for bitcoin, and wei for ethereum.\n\n#### Sealing Mode\n\nBy default, MyCloud seals in 'single' sealing mode, meaning it seals objects individually. If you're up to MyCloud version `v2.3.0`, you can change the sealing mode to 'batch'. For example, to batch objects every 10 minutes, and create one seal per batch, you would run:\n\n`tradleconf set-sealing-mode --mode batch --period-in-minutes 10`\n\nTo switch back to 'single' mode:\n\n`tradleconf set-sealing-mode --mode single`\n\n### Alerts\n\nAfter deploying MyCloud (and sometimes after a major update), you will receive an email from AWS at the admin email address you specified, asking you to confirm an SNS subscription (Amazon's Simple Notification Service). If you want your MyCloud to alert you when its balance is low, and/or about other issues, confirm that subscription.\n\n### Built-in Plugins\n\nFind below annotated examples from [./conf/bot.sample.json](./conf/bot.sample.json)\n\n#### Terms and Conditions\n\nPurpose: require new users to accept T's and C's before anything else\n\nPrerequisite: deploy terms and conditions as described [above](#custom-terms-and-conditions)\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"termsAndConditions\": {\n    \"enabled\": true\n  }\n}\n```\n\n#### Lens\n\nPurpose: request common forms with custom lenses\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"lens\": {\n    // for the nl.tradle.DigitalPassport product...\n    \"nl.tradle.DigitalPassport\": {\n      // when requesting form tradle.PhotoID, specify lens io.safere.lens.PhotoID\n      \"tradle.PhotoID\": \"io.safere.lens.PhotoID\"\n    }\n  }\n}\n```\n\n#### Prefill form\n\nPurpose: prefill forms sent to the user with sensible defaults\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"prefillForm\": {\n    // for the nl.tradle.DigitalPassport product...\n    \"nl.tradle.DigitalPassport\": {\n      // when requesting form tradle.PhotoID, prefill country to New Zealand\n      \"tradle.PhotoID\": {\n        \"country\": {\n          \"id\": \"tradle.Country_NZ\"\n        }\n      }\n    }\n  }\n}\n```\n\n#### ComplyAdvantage\n\nPurpose: upon receiving certain forms from the user, trigger checks using Comply Advantage API\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"complyAdvantage\": {\n    \"credentials\": {\n      \"apiKey\": \"...\"\n    },\n    \"products\": {\n      // for the tradle.CordaKYC product...\n      \"tradle.CordaKYC\": {\n        \"filter\":  {\n          \"fuzziness\": 1,\n          \"filter\": {\n            \"types\": [\"sanction\"]\n          }\n        },\n        // Create a property map you want to use for running this check.\n        // Property map's values are the property in the form and keys how they named in plugin.\n        // Properties could be derived from different forms.\n        // Here is an example when data are derived from one form the tradle.BusinessInformation\n        // with the following ComplyAdvantage API settings:\n        \"propertyMap\": {\n          \"tradle.BusinessInformation\": {\n            \"companyName\": \"companyName\",\n            \"registrationDate\": \"registrationDate\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n#### OpenCorporates\n\nPurpose: upon receiving certain forms from the user, trigger checks using OpenCorporates\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"openCorporates\": {\n    \"apiKey\": \"...\",\n    \"products\": {\n      \"tradle.CordaKYC\": [\n        \"tradle.BusinessInformation\"\n      ]\n    }\n  }\n}\n```\n\n#### Onfido\n\nPurpose: upon receiving certain forms from the user, trigger checks using Onfido\n\nNote: currently this is available only for the products tradle.onfido.CustomerVerification and tradle.pg.CustomerOnboarding. Will be generally available soon.\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"onfido\": {\n    \"apiKey\": \"...\"\n  }\n}\n```\n\n#### Centrix\n\nPurpose: upon receiving certain forms from the user, trigger checks using Centrix\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"centrix\": {\n    \"credentials\": {\n      \"test\": true, // use test server\n      \"httpCredentials\": {\n        \"username\": \"...\",\n        \"password\": \"...\"\n      },\n      \"requestCredentials\": {\n        \"subscriberId\": \"...\",\n        \"userId\": \"...\",\n        \"userKey\": \"...\"\n      }\n    },\n    \"products\": {\n      \"nl.tradle.DigitalPassport\": {}\n    }\n  }\n}\n```\n#### Document Checker\n\nProvider: DocumentChecker\nPurpose: Check authenticity of the Photo ID document using Keesing Document Checker.\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"documentChecker\": {\n    \"account\": \"...\",\n    \"username\": \"...\",\n    \"test\": true\n  }\n}\n```\n#### TrueFace\n\nProvider: TrueFace\nPurpose: detect whether a selfie is a spoof\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"trueface\": {\n    \"token\": \"...\",\n    \"products\": {\n      \"nl.tradle.DigitalPassport\": [\n        \"tradle.Selfie\"\n      ],\n      \"tradle.CertifiedID\": [\n        \"tradle.Selfie\"\n      ]\n    }\n  }\n}\n```\n\n#### RankOne\n\nProvider: RankOne\nPurpose:\n- compare photo id vs selfie photo for similarity\n- analyze a photo with a face, extract various information such as demographics and orientation\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"rankone-checks\": {\n    // no options at the moment\n  }\n}\n```\n\n#### FacialRecognition\n\nPurpose: upon receiving PhotoID and Selfie forms, trigger checks using NtechLab Facial Recognition\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"facial-recognition\": {\n    \"url\": \"http://...\", // URL ntechlab server\n    \"token\": \"...\",\n    \"threshold\": \"strict\"\n  }\n}\n```\nTo test it you need to run local tunnel\n\n`lt -p 4572 -s pick-a-hostname`\n\nIt will return url that you pass as a parameter to your local server\n\n`S3_PUBLIC_FACING_HOST=https://pick-a-hostname.localtunnel.me node --debug --inspect --max_old_space_size=4096 ./node_modules/.bin/sls offline start`\n\n#### DocumentValidity\n\nPurpose: upon receiving PhotoID form, check the validity of expiration date, viable age, countries of nationality and issuer if applicable\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"documentValidity\": {\n  }\n  // ...\n}\n```\n\n#### Customize message\n\nPurpose: customize the messages for various types sent to the user (e.g. form requests)\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"customize-message\": {\n    \"tradle.FormRequest\": {\n      \"tradle.ProductRequest\": \"See our list of products\",\n      \"tradle.TermsAndConditions\": \"Please review our Terms and Conditions\",\n      \"tradle.PhotoID\": \"Please click to scan your **ID document**\",\n      \"tradle.Selfie\": \"Thank you. Now take a '**selfie**' photo of yourself that I can match against your ID document\",\n      \"tradle.Residence\": {\n        \"first\": \"Thank you. Now I need you to provide your **residence** information\",\n        \"nth\": \"Thank you. Do you have another **residence**? If yes, tap Add, otherwise tap Next\"\n      },\n      \"tradle.ApplicationSubmitted\": {\n        \"tradle.nl.DigitalPassport\": \"You're all done! We'll get back to you shortly\"\n      }\n    }\n  }\n}\n```\n\n#### Webhooks\n\nPurpose: subscribe to events, handle them outside MyCloud\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"webhooks\": {\n    // optional. If provided, webhook requests will carry an hmac of the body\n    // in the x-webhook-auth header (see ./examples/webhook-handler.js)\n    \"hmacSecret\": \"[a private random string]\",\n    // subscriptions to events you want to receive\n    \"subscriptions\": [\n      // ... get notified about all inbound messages\n      {\n        \"topic\": \"msg:i\",\n        \"endpoint\": \"https://example.com/tradle/webhook1\"\n      },\n      // ... get notified about inbound messages of a particular type\n      {\n        \"topic\": \"msg:i:tradle.PhotoID\",\n        \"endpoint\": \"https://example.com/tradle/webhook2\"\n      },\n      // ... get notified when a resource is saved\n      {\n        \"topic\": \"save\",\n        \"endpoint\": \"https://example.com/tradle/webhook3\"\n      },\n      // ... get notified when a particular type of resource is saved\n      {\n        \"topic\": \"save:tradle.Application\",\n        \"hmacSecret\": \"use a different hmacSecret per subscriptin if you want\",\n        \"endpoint\": \"https://example.com/tradle/webhook4\"\n      }\n    ]\n  }\n}\n```\n\nSee an example webhook processor in [./examples/webhooks](./examples/webhooks/index.js). To run it:\n\n```sh\ncd examples/webhooks\nnpm install\nnpm start\n```\n\n#### Deployment\n\nPurpose: required to support the `tradle.cloud.Deployment` product. This product allows others to deploy MyCloud children based on your own MyCloud\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"deployment\": {\n    \"senderEmail\": \"[an email address you control]\",\n    \"replication\": {\n      \"regions\": [\n        // regions you want to support\n        \"us-east-1\",\n        \"ap-southeast-2\"\n      ]\n    }\n  }\n}\n```\n#### Conditional auto-approve\n\nPurpose: allow to auto approve customer application if all the listed checks passed. **Any check not included in this list will not prevent auto-approval once the required checks have passed.**\n```js\n...\n\"plugins\": {\n  // ...\n  \"conditional-auto-approve\": {\n    \"products\": {\n      // If you want to auto-approve application when all checks Pass\n      \"tradle.Quotation\": {},\n      // If you want to auto-approve application when only listed checks Pass\n      \"tradle.CertifiedID\": {\n        \"checks\": [\n          // List of checks that need to 'Pass' in order to auto-approve the application\n          \"tradle.SanctionsCheck\",\n          \"tradle.DocumentValidityCheck\",\n          ...\n        ]\n      },\n      \"tradle.CorporateBankAccount\": {\n        \"checks\": [\n          \"tradle.CorporationExistsCheck\",\n          \"tradle.SanctionsCheck\",\n          ...\n        ]\n      }\n    }\n  }\n}\n```\n#### Sme onboarding\n\nPurpose: allow to prefill subsidiary application from associated resource created when main application was submitted\n```js\n...\n\"plugins\": {\n  // ...\n  \"sme-onboarding\": {}\n}\n```\n#### Sme auto-approve\n\nPurpose: allow to auto approve SME application if all child applications (subsidiaries, controlling persons) were approved\n```js\n...\n\"plugins\": {\n  // ...\n  \"sme-auto-approve\": [\n    {\n      \"child\": \"tradle.legal.ControllingPersonOnboarding\",\n      \"parent\": \"tradle.legal.LegalEntity\"\n    },\n    ...\n  ]\n}\n```\n#### Data Import / Remediation\n\nIf you already have data from a customer and don't want them to re-enter it, you can have them import it in their Tradle app by scanning a QR code. To create the data bundle and claim stub, see  [./docs/data-import.md](https://github.com/tradle/tradleconf/blob/master/docs/data-import.md)\n\n#### Required Forms\n\nPurpose: customize a product's required forms\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"required-forms\": {\n    \"tradle.EmployeeOnboarding\": [\n      \"tradle.PhotoID\"\n    ]\n  }\n}\n```\n#### Controlling person registration\n\nPurpose: When SME administrator fills out CP and CE for officers and beneficial owners (BO) of the company, the notification should be sent out for the corresponding officer and/or BO to get onboarded\n```js\n...\n\"plugins\": {\n  // ...\n  \"controllingPersonRegistration\": {\n    \"senderEmail\": \"...\",\n    \"products\": {\n      \"io.legal.LegalEntity\": [\n        \"tradle.legal.LegalEntityControllingPerson\"\n      ],\n      ...\n    }\n  }\n}\n```\n#### Controlling entity validation\n\nPurpose: When SME administrator fills out CP and CE for officers and beneficial owners (BO) of the company, the notification should be sent out for the corresponding officer and/or BO to get onboarded\n```js\n...\n\"plugins\": {\n  // ...\n  \"controllingEntityValidation\": {\n    \"senderEmail\": \"...\",\n    \"products\": {\n      \"io.legal.LegalEntity\": [\n        \"tradle.legal.LegalEntityControllingPerson\"\n      ],\n      ...\n    }\n  }\n}\n```\n#### Verify Phone Number\n\nPurpose: verify a user controls a phone number\n\nExample config:\n\n```js\n// ...\n\"plugins\": {\n  // ...\n  \"verify-phone-number\": {\n    \"products\": {\n      \"tradle.CurrentAccount\": {\n        \"tradle.PersonalInfo\": {\n          \"property\": \"phones\"\n        }\n      }\n    }\n  }\n}\n```\n#### Prefill Beneficial Owners (BO)\n\nPurpose: Reduce/eliminate data entry for corporate onboarding. Information for prefill is taken from the passed Check resources that confirm company existence and list BO\n\nExample config:\n\n```js\n...\n\"plugins\": {\n  // ...\n  \"prefill-controllingPerson\": {\n    [product ID]: {\n      \"skipBo\": {\n        [form ID]: {\n           \"regulated\": true,\n           \"country\": [\"GB\", \"DE\"]\n        }\n      }\n    }\n  }\n}\n```\n#### Data lineage\n\nPurpose: Records the data and source of data prefilled from the third party sources and records all the changes made by client. Additionally creates a Check resource in case there was a prefill with 3rd party data and it differs from the changes the client applied to it.\n\nExample config:\n\n```js\n...\n\"plugins\": {\n  // ...\n  \"client-edits\": {\n    \"distance\": 5\n  }\n}\n```\n\n#### Inter-Form conditionals\n\nPurpose: change flow of the application based on the settings in previously submitted forms.\n\nExample config to request the form 'tradle.ProofOfAddress' only if the property 'country' in the previously submitted form 'tradle.Residence' is set to US\n\n```js\n...\n\"plugins\": {\n  // ...\n  \"tradle.Product\": [\n    \"tradle.Residence\",\n    ...\n    {\n      \"tradle.ProofOfAddress\": \"add: forms['tradle.Residence'].country = 'US'\"\n    }\n  ],\n}\n```\n\n### Troubleshooting\n\n#### tradleconf update\n\n**Symptom**: InvalidInput: expected \"adminEmail\"\n**Cause**: in MyCloud \u003c= 2.3.0, you need to confirm the AWS SNS Subscription for Alerts. Look for an email with subject \"AWS Notification - Subscription Confirmation\" and confirm it. If the confirmation expired, go to the AWS SNS Console for your AWS region (e.g. https://console.aws.amazon.com/sns/v2/home?region=us-east-1#/topics), find the topic that looks like `[your-stack-name]-alerts-alarm` (e.g. `tdl-tradle-ltd-dev-alerts-alarm`), and create and confirm an Email subscription to that topic.\n\n#### tradleconf enable-kyc-services\n\nThis command creates an additional CloudFormation stack. Should it fail when you run it, find the failed stack in the AWS CloudFormation console, and ask the Tradle team to help you interpret the error.\n\nIn general, this stack is stateless (doesn't store any data), so it's safe to delete and re-create.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Ftradleconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftradle%2Ftradleconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Ftradleconf/lists"}