tru.ID SDK for Mobile Web Applications

The Web SDK for tru.ID providing a helper function for requesting the check_url
for PhoneCheck and SubscriberCheck.
Installation
Via jsDelivr CDN
<script src="https://cdn.jsdelivr.net/npm/@tru_id/tru-sdk-web/dist/tru-id-sdk.umd.js"></script>
Via NPM
$ npm install @tru_id/tru-sdk-web
Usage
Via jsDelivr CDN
Reachability Check
<script src="https://cdn.jsdelivr.net/npm/@tru_id/tru-sdk-web/dist/tru-id-sdk.umd.js"></script>
<script>
tru.ID.getReachability(url)
</script>
PhoneCheck
When installed via a CDN a tru.ID
global is installed.
<script src="https://cdn.jsdelivr.net/npm/@tru_id/tru-sdk-web/dist/tru-id-sdk.umd.js"></script>
<script>
tru.ID.openCheckUrl(url, config)
</script>
Via NPM
Reachability Check
import truID from '@tru_id/tru-sdk-web'
truID.getReachability(url)
PhoneCheck
When installed via NPM the imported object exposes the openCheckUrl
function.
import truID from '@tru_id/tru-sdk-web'
truID.openCheckUrl(checkUrl, config)
openCheckUrl
Config
The openCheckUrl
function takes an optional config
Object argument:
truID.openCheckUrl(url, config)
The configuration options are:
{
debug: boolean,
checkMethod: "image" | "window",
windowCloseTimeout: Number,
checkDeviceCoverage: boolean,
version: "v0.1" | "v0.2",
}
Local development
You can run npm run dev
that will open rollup with watch mode that will re-compile the SDK after every change.
In another terminal you can run npm run serve
to open a test web page where you can test real phone checks if you have the node server running or you can simply check a PhoneCheck check_url
.
Releasing
- Bump the version if required
- Run
npm run changelog
to auto-update the CHANGELOG.md
and manually edit to finesse
- Commit the changes read for release:
git commit -m 'chore(release): v{version}
- Tag the release
git tag v{version}
- Push the tags
git push --follow-tags origin main
- Build the project with
npm run build
- Publish to NPM
npm publish --access public
License
MIT
Meta
Distributed under the MIT license. See LICENSE
for more information.
https://github.com/tru-ID