npm.io
4.12.2 • Published 5d ago

@adyen/kyc-components

Licence
MIT
Version
4.12.2
Deps
18
Size
16.0 MB
Vulns
0
Weekly
9.7K

Quick start

This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a legalEntityId to instatiate a Component.

Installing

Install the library

npm install @adyen/kyc-components

Available Adyen Components

Usage

Import the component you need, and use it as a custom-element.

Check component properties for details on what the properties are.

import "@adyen/kyc-components/transfer-instrument-configuration";

// in your HTML (or JSX, templating, etc.)

<adyen-transfer-instrument-configuration
  locale="en-US"
  environment="test"
  rootlegalentityid="myLegalEntityId"
  transferinstrumentid="testTransferInstrumentId"
  fetchToken="fetchToken"
></adyen-transfer-instrument-configuration>

Custom elements need closing tags, which means you need to have the closing </adyen-transfer-instrument-configuration>

FetchToken and Authentication

The fetchToken function needs to return a token. You will need to have an endpoint set up in your backend that returns { token: 'adyenValidToken' }. An endpoint is needed on your side in order to not expose your Adyen credentials in the frontend, and to be able to get a token with more granular permissions.

Done

This is all you need to get started. After integrating successful with the first Components, integrating others will be much easier, since the instantiation process is the same.

Keywords