oarocamera v2.2.2
Installation
To use this package in your project, follow these steps:
Install the package using npm:
npm install oarocamera
Import the package in your code:
import { OarocameraService } from 'oarocamera';
- Construct the service by injecting it into your component's constructor:
Now you have the package installed and ready to use in your project.``` constructor(private oarocameraService: OarocameraService) { }
Usage
Once the oarocamera service is injected, it must be started with the following method
await this.oarocameraService.init({
apiUrl: 'https://api_domain_here',
secret: 'your_secret',
apikey: 'your_api_key',
buttonStartId: 'btn-start',
resultContainerId: 'test'
});
Configuration Options
Here are the configuration options available when initializing the OarocameraService:
- buttonStartId: The ID of the button that initiates the process when clicked.
- resultContainerId: The ID of a container to display the results of the service.
- apiUrl: The URL of the API (domain not shown in README).
- apikey: The api key that oaro provided.
- secret: Secret that oaro provided.
OCR process
With the following method the ocr process starts:
this.oarocameraService.ocrFront({
onResult: this.onResultOcr,
beforeSend: this.beforeSend
});
Configuration Options
Here are the configuration options available for the ocr method:
- onResult: A callback function that executes at the end of the process.
- beforeSend: A function that executes during the process.
If the requireRearSide parameter in the response is true, you must call the following method:
this.oarocameraService.ocrBack();
Biometric process
With the following method the biometric process starts:
this.oarocameraService.biometric({
onResult: this.onResult,
beforeSend: this.beforeSend,
token: token
})
Configuration Options
Here are the configuration options available for the biometric method:
- onResult: A callback function that executes at the end of the process.
- beforeSend: A function that executes during the process.
- token: The token received in the ocr method.
Clearing the Process
You can use the this.oarocameraService.clearProcess() method to clear the HTML container and reset the API to its initial state. This is useful for starting a new process or cleaning up the container for a fresh interaction.
this.oarocameraService.clearProcess();
Feel free to use these methods as part of your integration with the service.
License
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
This means you are free to:
- Share: Copy and redistribute the material in any medium or format.
- Adapt: Remix, transform, and build upon the material.
Under the following terms:
- Attribution: You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- NonCommercial: You may not use the material for commercial purposes.
See the LICENSE file for more details about the CC BY-NC License.
Support and Contact
If you encounter any issues or have questions about this package, please don't hesitate to reach out to the administrator who provided you access to the repository. We welcome contributions and feedback.
That's it! You've successfully installed and set up the oarocamera package in your project. Happy coding!