-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
33 additions
and
0 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,3 @@ | ||
This folder is here to allow JSFiddle to be automatically created using this repo. | ||
|
||
You can [view the JSFiddle here](https://jsfiddle.net/gh/get/library/pure/onfido/onfido-sdk-ui/tree/master/demo/fiddle/). |
Empty file.
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,7 @@ | ||
--- | ||
name: Onfido SDK Demo | ||
authors: | ||
- Onfido Team | ||
resources: | ||
- https://sdk.onfido.com/v14/Onfido.iife.js | ||
... |
Empty file.
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,23 @@ | ||
const getToken = async () => { | ||
const response = await fetch('https://token-factory.onfido.com/sdk_token'); | ||
if (!response.ok) { | ||
throw new Error('Failed to get sdk token'); | ||
} | ||
|
||
return (await response.json()).message; | ||
} | ||
|
||
async function bootstrapSdk() { | ||
|
||
Onfido.init({ | ||
useModal: false, | ||
token: await getToken(), | ||
onComplete: (data) => { | ||
console.log('completed', data); | ||
}, | ||
onError: console.error, | ||
steps: ['welcome', 'document', 'face', 'complete'], | ||
}); | ||
} | ||
|
||
bootstrapSdk().catch(console.error); |