1.0.8 • Published 2 months ago

youverse-webcam-component v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

https://yk-website-images.s3.eu-west-1.amazonaws.com/LogoV4_TRANSPARENT.png

Youverse Webcam Component

License Version

Getting Started

npm install youverse-webcam-component

Integration via NPM

Install youverse-webcam-component:

npm i youverse-webcam-component

Import youverseWebcam from youverse-webcam-component into your .js file:

// If you use module bundler
import { youverseWebcam } from 'youverse-webcam-component';

// If you don't use module bundler
import { youverseWebcam } from './node_modules/youverse-webcam-component/js/dist/youverse-webcam.min.js';

Add the component name to the .html file.

<youverse-webcam 
    cancel-verification 
    change-camera
></youverse-webcam>

Integration via CDN

Connect the script in your .html file. Here is the CDN link: https://www.jsdelivr.com/package/npm/:package@:version/:file

For example:

<script src="https://cdn.jsdelivr.net/npm/youverse-webcam-component@latest/js/dist/youverse-webcam.min.js"></script>

Add the component name to the .html file.

<youverse-webcam 
    cancel-verification 
    change-camera
    locale="en"
></youverse-webcam>

Attributes

AttributeInfoData typeDefault ValueValues
face-position-checkOption for guided face positioningbooleantruetrue, false
cancel-verificationOption to cancel verification. If true, an option to cancel de verification will appearbooleanfalsetrue, false
change-cameraOption to change camera. If true and if exist multiple cameras, an icon to switch camera will appearbooleantruetrue, false
localeThe language of the component interfacestringenen, pt, es
colorThe color of the component interfacestring#492280hex color string
title-textText for the component title. Translation based on the language selectedstringTake a selfiestring
info-textText for the component info. Translation based on the language selectedstringMake sure that your face is in the frame and is visiblestring

Events

You can subscribe to the component events.

For example:

document.addEventListener('NEXT_STEP_EVENT', (event) => console.log(event.detail)); // Event

Type of events:

EventDescriptionEvent Handling
NEXT_STEP_EVENTEvent triggered when a selfie is takenHandled by a designated event listener in the application(listener)
CANCEL_EVENTEvent triggered when cancellation occursHandled by a designated event listener in the application(listener)
RESPONSE_NEXT_STEP_EVENTEvent to communicate with the component after NEXT_STEP_EVENTDispatched by the application to signal handling components(dispatch)
RESPONSE_CANCEL_EVENTEvent to communicate with the component after CANCEL_EVENTDispatched by the application to signal handling components(dispatch)

Response Events

Type of events:

EventResponse ParametersUsageDescription
NEXT_STEP_EVENT{ detail: { image: string } }event.detail.imageThe event returns an image
CANCEL_EVENTnullnullThe event has no return

For more information please contact us.

1.0.8

2 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago