Socket
Book a DemoInstallSign in
Socket

@silentauth/silentauth-sdk-web

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silentauth/silentauth-sdk-web

SDK for SilentAuth that provides a helper method for requesting the `check_url` for tru.ID's PhoneCheck and SubscriberCheck

latest
Source
npmnpm
Version
0.0.11
Version published
Maintainers
0
Created
Source

SilentAuth SDK for Mobile Web Applications

License

The Web SDK for SilentAuth providing helper functions to check whether the device is on a cellular data connection, and for requesting the SilentAuth check.

Installation

Via jsDelivr CDN

<script src="https://cdn.jsdelivr.net/npm/@silentauth/silentauth-sdk-web/dist/silentauth-sdk.umd.js"></script>

Via NPM

$ npm install @silentauth/silentauth-sdk-web

Usage

Via jsDelivr CDN

Reachability Check

<script src="https://cdn.jsdelivr.net/npm/@silentauth/silentauth-sdk-web/dist/silentauth-sdk.umd.js"></script>
<script>
  silentauth.getReachability(url)
</script>

PhoneCheck

When installed via a CDN a silentauth global is installed.

<script src="https://cdn.jsdelivr.net/npm/@silentauth/silentauth-sdk-web/dist/silentauth-sdk.umd.js"></script>
<script>
  silentauth.openCheckUrl(url, config)
</script>

Via NPM

Reachability Check

import silentauth from '@silentauth/silentauth-sdk-web'

silentauth.getReachability(url)

PhoneCheck

When installed via NPM the imported object exposes the openCheckUrl function.

import silentauth from '@silentauth/silentauth-sdk-web'

silentauth.openCheckUrl(checkUrl, config)

openCheckUrl Config

The openCheckUrl function takes an optional config Object argument:

silentauth.openCheckUrl(url, config)

The configuration options are:

{
  // whether debug information will be logged to the console.
  // Defaults to `false`
  debug: boolean,

  // "image" - a zero pixel image is dynamically added to the DOM for the check_url request
  // "window" - `window.open` is called to open the check_url in a new window
  // Defaults to "image".
  checkMethod: "image" | "window",

  // If `checkMethod` was set to `window` identifies the number of
  // milliseconds after which the opened window will be closed.
  // Defaults to 3000.
  windowCloseTimeout: Number,

  // It will run the device coverage check to determine
  // if the device is on a mobile IP
  // Defaults to true
  checkDeviceCoverage: boolean,

  // Depending on what PhoneCheck API version the check is created with.
  // Defaults to "v0.2"
  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/silentauth

Keywords

2FA

FAQs

Package last updated on 25 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.