You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@tap-payments/auth-jsconnect

Package Overview
Dependencies
29
Maintainers
0
Versions
755
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tap-payments/auth-jsconnect

connect library, auth


Version published
Weekly downloads
224
decreased by-78.36%
Maintainers
0
Created
Weekly downloads
 

Readme

Source

Auth-JsConnect

Handling user authentication and identification

Install

This is a React module available through the npm registry. Installation is done using the npm install command:

npm install @tap-payments/auth-jsconnect

---------------------------- OR -------------------------

yarn add @tap-payments/auth-jsconnect

Features

Examples

ES6

import { ConnectLib } from '@tap-payments/auth-jsconnect'

const App = () => {
	return (
		<ConnectLib
			open={true}
			merchantDomain={'https://www.example.com'}
			publicKey={'pk_test_xxxxxx'}
			appInfo={{
				identifier: 'tap_connect_demo',
				name: 'Tap Connect Demo',
				version: 'V2.0.0'
			}}
			businessCountryCode='SA'
			language='en'
			onError={(error) => {
				alert(JSON.stringify({ error }))
			}}
			onFlowCompleted={(data) => {
				console.log(data)
			}}
			onReady={() => {
				console.log('ready!')
			}}
			onStepCompleted={(name, data) => {
				console.log(name, data)
			}}
			onStepStarted={(name) => {
				console.log(name)
			}}
			scope={[]}
		/>
	)
}

Vanilla JS

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no" />
    <title>Auth-JsConnect</title>
    <script src="https://auth-jsconnect.b-cdn.net/build-2.0.0/main.js"></script>
    <link href="https://auth-jsconnect.b-cdn.net/build-2.0.0/main.css" rel="stylesheet" />
  </head>
  <body>
    <div id="root"></div>
    <script>
      const { renderConnectLib, unmountConnectLib } = window.TapAuth
      const startConnect = () => {
       const {unmount}= renderConnectLib(
                      {
                        open: true,
                        merchantDomain: window.location.origin,
                        publicKey: "pk_test_lat64TEDSvHrUOYAxVRe28PQ",
                        appInfo: {
                          identifier: "tap_connect_demo",
                          name: "Tap Connect Demo",
                          version: "V2.0.0"
                        },
                        businessCountryCode: "SA",
                        language: "en",
                        onError: (error) => {
                          alert(JSON.stringify({ error }))
                        },
                        onFlowCompleted: (data) => {
                          console.log(data)
                        },
                        onReady: () => {
                          console.log("ready!")
                        },
                        onStepCompleted: (name, data) => {
                          console.log(name, data)
                        },
                        onStepError: (name, error) => {
                          console.log(name, error)
                        },
                        onStepStarted: (name) => {
                          console.log(name)
                        },
                        scope: []
                      },

          "root"
        )
      }
      const stopConnect = () => {
        unmount("root")
      }

    </script>
    <button onclick="startConnect()">Start</button>
    <button onclick="stopConnect()">Stop</button>
  </body>
</html>

## Connect
- Help our merchants to create a account with Tap Payments

## Business

## Password

## Individual

## Bank

## Tax

Properties

namedescription
open required - booleanopen/close the library
merchantDomain required - stringdomain name https://expamle.com
publicKey required - stringmerchant public key
appInfo requiredit's an object from type AppInfo
businessCountryCode required - stringmerchant country code and it should be the ISO2 of the country
scope required - stringit's an string
language required - stringit can be enor ar
onError required - functioncallback function will call in case of any error happened
onFlowCompleted required - functioncallback function will called after completing the flow
onReady required - functioncallback function will call after loading library configuration
onStepError required - functioncallback function will call in case if any error happened in the screen
onStepStarted required - functioncallback function will call in the begging of each step

FAQs

Package last updated on 11 Jul 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc