@nanlabs/thirdparty
TypeScript icon, indicating that this package has built-in type declarations

0.3.9 • Public • Published

Third Party integrations

Documentation | Contributing

Continious Integration npm npm License: MIT

This library provides a set of tools that can be used in any web application. It provides integrations with third party libraries like Google ReCaptcha and more!

You can check our React library if you want to use the integrations in a React application.

Installation

npm install @nanlabs/thirdparty

Usage

The following example shows how one of the multiple integrations provided by this library can be used.

In the example bellow we use GoogleReCaptchaProvider and useGoogleReCaptcha to integrate reCAPTCHA v3 in our application.

You can find more examples in the documentation.

import React, { useState } from "react";
import { injectGoogleReCaptchaScript } from "@nanlabs/thirdparty";

injectGoogleReCaptchaScript({
  reCaptchaKey: "YOUR_RECAPTCHA_KEY",
  scriptId: "recaptcha-script",
});

window.onload = () => {
  const reCaptcha = window.grecaptcha;
  reCaptcha.ready(() => {
    reCaptcha
      .execute("YOUR_RECAPTCHA_KEY", { action: "login_page" })
      .then((token) => {
        // Do something with the token
      });
  });
};

Readme

Keywords

none

Package Sidebar

Install

npm i @nanlabs/thirdparty

Weekly Downloads

0

Version

0.3.9

License

MIT

Unpacked Size

8.18 kB

Total Files

5

Last publish

Collaborators

  • ulises-jeremias
  • nanlabs1