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

@funpodium/fp-captcha-client-js-sdk

v0.15.12

Published

fpCaptcha client SDK for JavaScript

Downloads

28

Readme

fpCaptcha Client JS SDK

🚧 This is still a WIP project, do not use this in production. 🚧

install

  1. Follow this guide to retrieve a GitLab personal access token.
  2. Run these lines in shell to add the config to npm.
$ npm config set @funpodium:registry https://gitlab.com/api/v4/packages/npm/
$ npm config set -- '//gitlab.com/api/v4/packages/npm/:_authToken' "<your_personal_access_token>"
  1. Run one of these lines to add it to the project's package.json.
npm install @funpodium/fp-captcha-client-js-sdk
# or use yarn
yarn add @funpodium/fp-captcha-client-js-sdk

usage

FpCaptcha

all-in-one class that encapsulate the instructions of setting up the captcha interface.

import { FpCaptcha } from "@funpodium/fp-captcha-client-js-sdk";

const captcha = new FpCaptcha(canvasElement, options);

returns

FpCaptcha(instance)

arguments

| Position | Key | Type | Remark | | -------- | ------------- | ----------------- | ---------------------------------- | | 1 | canvasElement | HTMLCanvasElement | the canvas element | | 2 | options | FpCaptchaOptions | options to setup FpCaptcha service |

options

| Key | Type | Remark | | ------ | ------------------- | ---------------------------------- | | window | Window | A window containing a DOM document | | config | FpCaptchaConfigType | |

config (FpCaptchaConfigType)

| Key | Type | Remark | | ----------------- | ------ | ---------------------------------------- | | apiUrl | string | API endpoint to the fpCaptcha service | | chunkSize | number | chunk size for the decipher | | dragThreshold | number | drag active area on the map | | dismissTime | number | available for dragging after dismissTime | | applicationLocale | string | Locale of captcha |

methods

| Method name | Usage | | ----------------- | -------------------------------------------- | | build | to make challenge request and draw on canvas | | refresh | to re-request for another challenge | | teardown | to remove all listeners | | addResultListener | to add listeners after judgement |

method details

build

| Position | Key | Type | Remark | | -------- | ------------- | ------- | ------------------------------------------------------------------------------------ | | 1 | challengeUuid | string | challenge uuid | | 2 | isRefresh | boolean | default: false, if true => refresh only chart; if false => refresh the whole captcha |


teardown | Position | Key | Type | Remark | | -------- | --------------- | ------- | ------------------------------------------------------------------------------------ | | 1 | isRefresh | boolean | default: false, if true => refresh only chart; if false => refresh the whole captcha |


addResultListener | Position | Key | Type | Remark | | -------- | --------------- | ------- | ------------------------------------------------------------------------------------ | | 1 | callback | (judgement: FpCaptchaJudgement)=> void | callback after judgement |


FpCaptchaView

all-in-one class that encapsulate the captcha view.

import { FpCaptchaView } from "@funpodium/fp-captcha-client-js-sdk";

const captcha = new FpCaptchaView(config);

returns

FpCaptchaView(instance)

arguments

| Position | Key | Type | Remark | | -------- | -------- | ------------------- | --------------------------------- | | 1 | config | FpCaptchaConfigType | config to setup FpCaptcha service |

methods

| Method name | Usage | | ---------------- | -------------------------------------------- | | mount | to create elements onto document | | unmount | to remove all elements from document | | build | to make challenge request and draw on canvas | | addEventListener | to add listeners to various events |

method details

build | Position | Key | Type | Remark | | -------- | --------------- | ------- | ------------------------------------------------------------------------------------ | | 1 | challengeUuid | string | challenge uuid |


addEventListener | Position | Key | Type | Remark | | -------- | --------------- | ------- | ------------------------------------------------------------------------------------ | | 1 | eventType | 'open' | 'passed'| 'failed' | 'close' | event listener typ | | 2 | callback | (args: unknown)=> void | callback after specific type of event happened|