-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into enh/global-doc-verification
- Loading branch information
Showing
47 changed files
with
6,996 additions
and
13,914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: lint | ||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: set node version | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run lint:html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,72 @@ | ||
# hosted-web-integration | ||
|
||
[![Cypress Tests](https://github.com/smileidentity/hosted-web-integration/actions/workflows/main.yml/badge.svg)](https://github.com/smileidentity/hosted-web-integration/actions/workflows/main.yml) | ||
|
||
Self Hosted Integration for Smile Identity on the Web | ||
## Overview | ||
|
||
This repository provides a self-hosted integration for Smile ID on the Web. It encompasses a comprehensive set of utilities for KYC processes, biometric verification, and more. Public documentation [here](https://docs.usesmileid.com/integration-options/web-mobile-web/web-integration). | ||
|
||
## Prerequisites | ||
|
||
- Ensure you have [Node.js](https://nodejs.org/) installed. | ||
- Install [nvm (Node Version Manager)](https://github.com/nvm-sh/nvm) for managing Node.js versions. | ||
|
||
## Setup | ||
|
||
1. Clone the repository: | ||
|
||
```bash | ||
git clone https://github.com/smileidentity/hosted-web-integration.git | ||
cd hosted-web-integration | ||
``` | ||
|
||
2. Switch to the appropriate Node version using `nvm`: | ||
|
||
```bash | ||
nvm install | ||
nvm use | ||
``` | ||
|
||
3. Install project dependencies: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
## Running the Project | ||
|
||
1. Build the project: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
2. Start the local server: | ||
|
||
```bash | ||
npm start | ||
``` | ||
|
||
3. Access the application on `http://localhost:8000`. | ||
|
||
### Configuration | ||
|
||
- `.git-blame-ignore-revs`: File used to ignore certain commits in `git blame`. | ||
- `.gitignore`: Specifies files to ignore in git. These include [./dist](./dist) and [./build](./build). | ||
- `.nvmrc`: Node Version Manager configuration file. | ||
- `.nycrc`: [NYC](https://github.com/istanbuljs/nyc) configuration file. | ||
|
||
## Testing | ||
|
||
Run Cypress tests using: | ||
|
||
```bash | ||
npm test | ||
``` | ||
|
||
NOTE: the `npm start` command must be running in a separate terminal window. | ||
|
||
### Cypress Configuration & Pages | ||
|
||
- `cypress.config.js`: Main Cypress configuration file. | ||
- `cypress/pages/`: Contains all the utility pages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
<!doctype html> | ||
<html lang='en'> | ||
<head> | ||
<meta name='viewport' content='width=device-width, initial-scale=1' /> | ||
<style> | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
<html lang="en"> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<style> | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
max-width: 100%; | ||
min-height: 100%; | ||
} | ||
</style> | ||
</head> | ||
body { | ||
max-width: 100%; | ||
min-height: 100%; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<script | ||
src='js/script.min.js'> | ||
</script> | ||
<body> | ||
<script src="js/script.min.js"></script> | ||
|
||
<script> | ||
SmileIdentity({ | ||
token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX3BhcmFtcyI6eyJ1c2VyX2lkIjoid2ViLXRva2VuLXRlc3QtdXNlci0xMDEiLCJqb2JfaWQiOiJ3ZWItdG9rZW4tam9iLTIzMDEiLCJqb2JfdHlwZSI6Mn0sImNhbGxiYWNrX3VybCI6Imh0dHBzOi8vd2ViaG9vay5zaXRlLzFhYWE3YTdiLWFjY2ItNDBhYy04NjQzLWZkOGE4NzAzZTliZSIsImlhdCI6MTY0ODIzODM2NCwiZXhwIjoxNjQ5ODg2NTk1fQ.PXqtgX3m6XTbHfDkxz0Yc-Z1EoblkrOeq1UFQqM9ix4', | ||
product: 'authentication', | ||
callback_url: 'https://webhook.site/1aaa7a7b-accb-40ac-8643-fd8a8703e9be', | ||
environment: 'sandbox', | ||
consent_required: { | ||
'NG': ['BVN'] | ||
}, | ||
partner_details: { | ||
name: 'Test Org', | ||
logo_url: 'https://portal.smileidentity.com/favicon.ico', | ||
partner_id: '212', | ||
policy_url: 'https://smileidentity.com/privacy-policy', | ||
theme_color: '#000', | ||
}, | ||
onSuccess: () => { | ||
}, | ||
onClose: () => { | ||
}, | ||
}); | ||
</script> | ||
</body> | ||
<script> | ||
SmileIdentity({ | ||
token: | ||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX3BhcmFtcyI6eyJ1c2VyX2lkIjoid2ViLXRva2VuLXRlc3QtdXNlci0xMDEiLCJqb2JfaWQiOiJ3ZWItdG9rZW4tam9iLTIzMDEiLCJqb2JfdHlwZSI6Mn0sImNhbGxiYWNrX3VybCI6Imh0dHBzOi8vd2ViaG9vay5zaXRlLzFhYWE3YTdiLWFjY2ItNDBhYy04NjQzLWZkOGE4NzAzZTliZSIsImlhdCI6MTY0ODIzODM2NCwiZXhwIjoxNjQ5ODg2NTk1fQ.PXqtgX3m6XTbHfDkxz0Yc-Z1EoblkrOeq1UFQqM9ix4", | ||
product: "authentication", | ||
callback_url: | ||
"https://webhook.site/1aaa7a7b-accb-40ac-8643-fd8a8703e9be", | ||
environment: "sandbox", | ||
consent_required: { | ||
NG: ["BVN"], | ||
}, | ||
partner_details: { | ||
name: "Test Org", | ||
logo_url: "https://portal.smileidentity.com/favicon.ico", | ||
partner_id: "212", | ||
policy_url: "https://smileidentity.com/privacy-policy", | ||
theme_color: "#000", | ||
}, | ||
onSuccess: () => {}, | ||
onClose: () => {}, | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,56 @@ | ||
<!doctype html> | ||
<html lang='en'> | ||
<head> | ||
<meta name='viewport' content='width=device-width, initial-scale=1' /> | ||
<style> | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
<html lang="en"> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<style> | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
max-width: 100%; | ||
min-height: 100%; | ||
} | ||
</style> | ||
</head> | ||
body { | ||
max-width: 100%; | ||
min-height: 100%; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<script | ||
src='js/script.min.js'> | ||
</script> | ||
<body> | ||
<script src="js/script.min.js"></script> | ||
|
||
<script> | ||
function displayError (error) { | ||
const errorDiv = document.createElement('div') | ||
errorDiv.setAttribute('class', 'validation-message'); | ||
errorDiv.textContent = error; | ||
document.body.appendChild(errorDiv); | ||
} | ||
<script> | ||
function displayError(error) { | ||
const errorDiv = document.createElement("div"); | ||
errorDiv.setAttribute("class", "validation-message"); | ||
errorDiv.textContent = error; | ||
document.body.appendChild(errorDiv); | ||
} | ||
|
||
SmileIdentity({ | ||
token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX3BhcmFtcyI6eyJ1c2VyX2lkIjoid2ViLXRva2VuLXRlc3QtdXNlci0wMDEiLCJqb2JfaWQiOiJ3ZWItdG9rZW4tam9iLTEyMyIsImpvYl90eXBlIjo1fSwiY2FsbGJhY2tfdXJsIjoiaHR0cHM6Ly93ZWJob29rLnNpdGUvMWFhYTdhN2ItYWNjYi00MGFjLTg2NDMtZmQ4YTg3MDNlOWJlIiwiaWF0IjoxNjQ2OTQxNTQ5LCJleHAiOjE2NDg1ODg0ODN9.D83B4jSgQGJfSnQ5xALKea48okutLpbTcqojJTk4iGI', | ||
product: 'basic_kyc', | ||
callback_url: 'https://webhook.site/1aaa7a7b-accb-40ac-8643-fd8a8703e9be', | ||
environment: 'sandbox', | ||
partner_details: { | ||
name: 'Test Org', | ||
logo_url: 'https://portal.smileidentity.com/favicon.ico', | ||
partner_id: '212', | ||
policy_url: 'https://smileidentity.com/privacy-policy', | ||
theme_color: '#000', | ||
}, | ||
onSuccess: () => { | ||
}, | ||
onClose: () => { | ||
displayError('User triggered this close action'); | ||
}, | ||
onError: (data) => { | ||
displayError(JSON.stringify(data, null, 2)); | ||
}, | ||
}); | ||
</script> | ||
</body> | ||
SmileIdentity({ | ||
token: | ||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX3BhcmFtcyI6eyJ1c2VyX2lkIjoid2ViLXRva2VuLXRlc3QtdXNlci0wMDEiLCJqb2JfaWQiOiJ3ZWItdG9rZW4tam9iLTEyMyIsImpvYl90eXBlIjo1fSwiY2FsbGJhY2tfdXJsIjoiaHR0cHM6Ly93ZWJob29rLnNpdGUvMWFhYTdhN2ItYWNjYi00MGFjLTg2NDMtZmQ4YTg3MDNlOWJlIiwiaWF0IjoxNjQ2OTQxNTQ5LCJleHAiOjE2NDg1ODg0ODN9.D83B4jSgQGJfSnQ5xALKea48okutLpbTcqojJTk4iGI", | ||
product: "basic_kyc", | ||
callback_url: | ||
"https://webhook.site/1aaa7a7b-accb-40ac-8643-fd8a8703e9be", | ||
environment: "sandbox", | ||
partner_details: { | ||
name: "Test Org", | ||
logo_url: "https://portal.smileidentity.com/favicon.ico", | ||
partner_id: "212", | ||
policy_url: "https://smileidentity.com/privacy-policy", | ||
theme_color: "#000", | ||
}, | ||
onSuccess: () => {}, | ||
onClose: () => { | ||
displayError("User triggered this close action"); | ||
}, | ||
onError: (data) => { | ||
displayError(JSON.stringify(data, null, 2)); | ||
}, | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.