@adyen/bpscaweb
v0.1.5
Published
Balance Platform SCA Web library
Downloads
229
Keywords
Readme
Balance Platform SCA Web
This library offers an easy way to perform operations with Strong Customer Authorization. This library is based on WebAuthn to guarantee the security of the operations.
Installation
You can use this library direclty on your browser or you can add as a dependency on your JS project.
With npm do
npm install @adyen/bpscawebWith browsers do
<script type="module" src="bpscaweb.es.js"></script>
<script type="module">
import ScaWebauthn from '/js/bpscaweb.es.js';
...
</script>In your TS project do
import ScaWebauthn from '@adyen/bpscaweb';Configuration
Once you have installed the component, you can configure it when you create a new handler.
const handler = ScaWebauthn.create(options);Options
These are the options you can pass to the component
| Option | Required | Type | Description | | :---------------: | :--------------------------: | :--------------------------: | :---------------------------------------------- | | relyingPartyName | Yes | string | A string representing the name of the relying party. This is the name the user will be presented with when creating or validating a WebAuthn operation. |
Example: Create a handler
const scaWebauthn = ScaWebauthn.create({
relyingPartyName: 'adyen_bpsca',
});Check availability
Check if SCA is available on the device.
const sdkOutput = await scaWebauthn.checkAvailability();Register device
Exchange the sdkInput return by the backend in the initiate register call
const sdkOutput = await scaWebauthn.register(sdkInput); // the new output that will be shared with the server to complete the registrationAuthenticate device
Exchange the sdkInput return by the backend in the first call
const sdkOutput = await scaWebauthn.authenticate(sdkInput); // the new output that will be shared with the server to authenticate the call