Client Token and Domain Management
How do I obtain and configure the client token and domain?
The client token is obtained by registering at app.face-auth.me. After registration, the platform generates the client token and allows you to choose a domain.
How do I reset or replace the client token if it is compromised?
If you decide to regenerate the client token from app.face-auth.me, you need to update the client token used to initialize the package.
How do I reset my domain if I made a mistake during registration?
You can change your domain by visiting the settings page in app.face-auth.me and updating it accordingly.
Are there any limitations on the domain I can choose?
There are a few guidelines to follow when selecting a domain:
- Domain Length: The domain must be between 3 and 128 characters long.
- Allowed Characters: It can include letters, numbers, and special characters allowed in URLs.
- Real Domain: While not required, using a real domain is recommended to ensure uniqueness. However, it does not need to be associated with an actual website.
Can I use the package with multiple domains?
Currently, the package supports one domain per client token. To use multiple domains, you would need to generate separate tokens for each.
How should developers handle scenarios where the client token might need to be updated or replaced?
The client token is a unique, secret identifier for each client and does not expire. As a result, there is no need to periodically renew or replace it. This client token is used to generate session tokens, which are integrated into API requests for validation and authorization. The npm package takes care of generating, refreshing, and updating these session tokens automatically. Therefore, developers do not need to manage token updates or replacements manually.
Integration and Usage
How do I integrate the package into my codebase?
To integrate @face-auth/face-id into your project, follow these steps:
Install the Package: Use npm to install the package:
npm install @face-auth/face-id
Bash
Import the Package: Import the package into your code.
For CommonJS:
const FaceId = require('@face-auth/face-id');
TypeScript
For ES6 modules:
import FaceId from '@face-auth/face-id';
TypeScript
Initialize the Package: Initialize the package with your domain and client token:
const faceId = new FaceId('<domain>', '<client_token>');
TypeScript
Use the Package: You can now use the methods provided by the package, such as register and identify.
Are there specific code snippets or examples that demonstrate the integration process?
On this documentation search for the section “Basic code example”.
Can the package be used in a client-side or frontend application?
Yes, the package is designed to be compatible with client-side or frontend applications. It can be integrated directly into web applications where it interacts with the user’s browser. This setup is particularly useful for scenarios like user authentication or face identification through a web interface. Ensure that the client token and other sensitive data are handled securely, following best practices for client-side security to protect against potential vulnerabilities.
Can the package be used in a serverless environment?
Yes, the package can be used in serverless environments like AWS Lambda, Azure Functions, or Google Cloud Functions. Ensure that you configure the environment correctly for secure API access.
What types of images are supported for face recognition?
The package supports various image formats, including PNG, JPEG, and BMP. Ensure that images are of high quality for accurate face recognition.
Testing and Upgrades
How can I test the package before using it in a production environment?
Use a development or staging environment to test the package. Ensure that you are working with test data and have robust error handling in place.
How do I upgrade to a newer version of the package?
You can upgrade the package using npm by running:
npm update @face-auth/face-id
Bash
Review the release notes for any breaking changes or new features.
Error Handling and Support
What are the common errors I might encounter and how do I resolve them?
Some common errors include:
- Invalid Token: Ensure that the client token and domain are correctly configured.
- Network Issues: Check your network connection and API endpoint configurations.
- API Limits: Verify that you are not exceeding any API rate limits or usage quotas.
What should I do if the package’s methods are not behaving as expected?
Verify that you are using the correct parameters and initialization. Check for updates to the package and review the documentation for any changes that may affect usage. For support, you can contact our support team through support@face-auth.me.
How can I handle exceptions or errors during API calls?
Use try-catch blocks to manage exceptions. Ensure proper error handling in your application to address potential issues.
Is there a support available for additional help?
For support, you can contact our support team through support@face-auth.me.
API Limits and Best Practices
Are there any rate limits or usage quotas for the API?
Yes, the API is subject to rate limits to prevent abuse and ensure fair usage. Each API plan has specific limits and quotas that determine how much the API can be used. These limits vary depending on the plan you have contracted. For detailed information on rate limits, usage quotas, and how they apply to different plans, please refer to the API documentation or your account settings.