authmatech-sdk-web
v1.0.3
Published
A lightweight JavaScript SDK for seamless, passwordless mobile number verification through mobile operator network (MNOs).
Maintainers
Readme
Authmatech SDK WEB
A lightweight JavaScript SDK for seamless, passwordless mobile number verification through mobile operator network (MNOs).
Client-side Only
The SDK runs entirely in front-end browser code; no server integration is required.
Mobile Browser Only
This library is intended for use exclusively in mobile browsers.
Overview
Authmatech SDK WEB enables silent mobile-network-based verification by integrating with Authmatech. It handles getting Authmatech code, response parsing, and error handling for both modern module bundlers and browser <script> tags.
Features
- Client-side Only: The SDK runs entirely in the browser—no server-side components needed.
- Mobile Browser Only: Designed for mobile browsers; desktop usage is not supported.
- Automatic Getting Authmatech Code
- Error Handling: Built‑in checks for network protocol and flow errors.
- Flexible Integration: Supports ES modules, CommonJS bundlers, and UMD for script tags.
Installation
Install via npm:
npm install authmatech-sdk-webOr yarn:
yarn add authmatech-sdk-webUsage
Below are two common integration patterns:
ES Module (Webpack, Rollup, Parcel, etc.)
Import and initialize the check in your modern build:
import { initAuthmatechCheck } from 'authmatech-sdk-web';
// 1) Generate or supply your transaction ID (prefix will be provided by us)
const transactionId = 'prefix-550e8400-e29b-41d4-a716-446655440000';
// 2) Call the SDK
initAuthmatechCheck({
transactionId,
checkUrl: 'https://web.authmatech.com/verify'
});UMD Bundle (Browser)
Include the prebuilt UMD bundle via a CDN or your host:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/authmatech-sdk-web.umd.min.js"></script>
<script>
(function(){
// 1) Your generated transaction ID
var transactionId = 'prefix-550e8400-e29b-41d4-a716-446655440000';
// 2) Fire the check
AuthmatechSDKWeb.initAuthmatechCheck({
transactionId: transactionId,
checkUrl: 'https://web.authmatech.com/verify'
});
})();
</script>API
initAuthmatechCheck(config)
| Option | Type | Required | Description |
| --------------- | ------ | -------- | ------------------------------------------------------------- |
| transactionId | string | Yes | Your full transaction ID (format: prefix-<UUIDv4>). |
| checkUrl | string | Yes | Will be provided by Authmatech |
Throws an error if:
transactionIdis missing or empty.checkUrlis missing, invalid, or not usinghttps:protocol.
Browser Compatibility
- Modern browsers supporting ES modules or UMD script tags.
Security & Privacy
- No Local Storage: No personal data is stored by the SDK.
License
Distributed under the MIT License.
