npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@silentauth/silentauth-sdk-web

v0.0.11

Published

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

Downloads

1

Readme

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

  1. Bump the version if required
  2. Run npm run changelog to auto-update the CHANGELOG.md and manually edit to finesse
  3. Commit the changes read for release: git commit -m 'chore(release): v{version}
  4. Tag the release git tag v{version}
  5. Push the tags git push --follow-tags origin main
  6. Build the project with npm run build
  7. Publish to NPM npm publish --access public

License

MIT

Meta

Distributed under the MIT license. See LICENSE for more information.

https://github.com/silentauth