### Build and Run with Docker Compose Source: https://dev.facetec.com/standard-server-and-dashboard Builds the Docker images and starts the FaceTec Standard Server using Docker Compose. Requires Docker and Docker Compose to be installed. ```bash $ docker-compose build $ docker-compose up ``` -------------------------------- ### Install and Run Simple HTTP Server Source: https://dev.facetec.com/api-postman-test-suite Install and run a simple HTTP server to serve FaceTec Test Data. Ensure you run this from the root directory of the extracted FaceTec Test Suite. ```bash npm install -g simplehttpserver simplehttpserver ``` ```bash python -m SimpleHTTPServer 8000 ``` ```bash python3 -m http.server ``` -------------------------------- ### Install Node.js Dependencies Source: https://dev.facetec.com/getting-started Run this command in the terminal from the root of the extracted directory to install necessary Node.js packages for the browser sample app. ```bash npm install ``` -------------------------------- ### Initializing the 3D-DB Source: https://dev.facetec.com/1-to-n-search This code example demonstrates how to initialize the 3D-DB by providing the path to the database directory. ```APIDOC ## Initialization Initialize your 3D-DB by passing the path to your 3D-DB Directory: ```java FaceTecSDKInstance facetecInstance = …; String databaseDirectory = "/path/to/load/search/database/from"; // Load an on-disk 3D-DB or start a new one if it doesn't exist FaceTecSearchGroup mySearchGroup = facetecInstance.createPersistedSearchGroup(databaseDirectory); ``` ``` -------------------------------- ### Install Debian Dependencies Source: https://dev.facetec.com/standard-server-and-dashboard Installs Java SE Development Kit and libgomp on Debian systems. Ensure you are in the root of your ZIP file before running. ```bash $ apt-get -y install -y default-jdk $ apt-get install -y libgomp1 ``` -------------------------------- ### Start 3D:3D Re-Verification Source: https://dev.facetec.com/api-call-list Starts a 3D:3D Re-Verification Session on the Device SDK. ```APIDOC ## Start 3D:3D Re-Verification ### Description Starts a 3D:3D Re-Verification Session on the Device SDK. ### Method `start3DLivenessThen3DFaceMatch` ### Parameters #### Core Inputs - **Session Request Processor** (object) - Required - The processor for handling session requests. - **External Database Reference ID** (string) - Required - A unique identifier for the external database. ``` -------------------------------- ### Get Ready Screen Additional Customizations Source: https://dev.facetec.com/ui-customization Provides additional customization options for the 'Get Ready' screen, including fonts and text colors for headers and subtexts. ```APIDOC ## Get Ready Screen - Additional Customizations ### APIs - `FaceTecGuidanceCustomization.readyScreenHeaderFont` - `FaceTecGuidanceCustomization.readyScreenHeaderTextColor` - `FaceTecGuidanceCustomization.readyScreenHeaderAttributedString` - `FaceTecGuidanceCustomization.readyScreenSubtextFont` - `FaceTecGuidanceCustomization.readyScreenSubtextTextColor` - `FaceTecGuidanceCustomization.readyScreenSubtextAttributedString` ``` -------------------------------- ### Build TypeScript Sample App Source: https://dev.facetec.com/getting-started Install dependencies and build the TypeScript sample app. This command should be run in a separate terminal within the 'sample-apps/sample-app-ts/' directory. ```bash npm install ``` ```bash npm run build ``` -------------------------------- ### Start 3D Liveness Source: https://dev.facetec.com/api-call-list Initiates a 3D Liveness Session on the Device SDK. Declaring an externalDatabaseRefID is required for Enrollment. ```APIDOC ## Start 3D Liveness ### Description Starts a 3D Liveness Session on the Device SDK. Declaring an externalDatabaseRefID is required for Enrollment. ### Method `start3DLiveness` ### Parameters #### Core Inputs - **Session Request Processor** (object) - Required - The processor for handling session requests. - **External Database Reference ID** (string) - Required - A unique identifier for the external database. ``` -------------------------------- ### Build and Run FaceTec Dashboard with Docker Source: https://dev.facetec.com/standard-server-and-dashboard Use these commands to build the Docker image and start the FaceTec Dashboard Web App Container. ```bash docker-compose build docker-compose up ``` -------------------------------- ### Get Ready Screen Customizations Source: https://dev.facetec.com/ui-customization Customize the 'Get Ready' screen, which helps users align their face in the FaceTec Oval for improved user experience and security checks. ```APIDOC ## Get Ready Screen Customizations ### APIs - `FaceTecGuidanceCustomization.headerFont` - `FaceTecGuidanceCustomization.subtextFont` ### Localization Strings - `FaceTec_instructions_header_ready_desktop` - `FaceTec_instructions_header_ready_1_mobile` - `FaceTec_instructions_header_ready_2_mobile` - `FaceTec_instructions_header_ready_1` - `FaceTec_instructions_header_ready_2` - `FaceTec_instructions_message_ready_1` - `FaceTec_instructions_message_ready_2` - `FaceTec_instructions_message_ready_desktop` - `FaceTec_instructions_message_ready_1_mobile` - `FaceTec_instructions_message_ready_2_mobile` - `FaceTecStrings.FaceTec_action_im_ready` ``` -------------------------------- ### Performing a Search Source: https://dev.facetec.com/1-to-n-search This code example illustrates how to perform a search against the 3D-DB using a FaceMap. ```APIDOC ## Searching To Search using a FaceMap, use code like the following: ```java FaceTecSearchResult searchResult = mySearchGroup.search(faceMapBytes); ``` ``` -------------------------------- ### FaceTec Start Methods Source: https://dev.facetec.com/v10.0.0-release-notes New and updated methods for initiating various FaceTec SDK sessions, including liveness detection, face matching, and ID scanning. ```APIDOC ## FaceTec Start Methods ### Description These methods are used to initiate different types of FaceTec SDK sessions. Each method corresponds to a specific core feature and utilizes a Session Request Processor. ### Methods - `FaceTecSDKInstance.start3DLiveness()` - `FaceTecSDKInstance.start3DLivenessThen3DFaceMatch()` - `FaceTecSDKInstance.start3DLivenessThen3D2DPhotoIDMatch()` - `FaceTecSDKInstance.startIDScanThen3D2DMatch()` - `FaceTecSDKInstance.startIDScanOnly()` - `FaceTecSDKInstance.startSecureOfficialIDPhotoCapture()` ``` -------------------------------- ### Run FaceTec Dashboard with Node.js Source: https://dev.facetec.com/standard-server-and-dashboard This option is suitable for development purposes and requires Node.js to be installed. It is not recommended for production environments. ```bash node --no-deprecation ./server/bundle.js ``` -------------------------------- ### Start FaceTec Dashboard with PM2 Source: https://dev.facetec.com/standard-server-and-dashboard PM2 is the recommended package for running the FaceTec Dashboard, especially in production environments, offering various configuration options. ```bash pm2 start ./server/bundle.js ``` -------------------------------- ### Start 3D:2D Photo ID Matching Source: https://dev.facetec.com/api-call-list Starts a 3D:2D Photo ID Matching Session on the Device SDK. ```APIDOC ## Start 3D:2D Photo ID Matching ### Description Starts a 3D:2D Photo ID Matching Session on the Device SDK. ### Method `start3DLivenessThen3D2DPhotoIDMatch`, `startIDScanThen3D2DMatch` ### Parameters #### Core Inputs - **Session Request Processor** (object) - Required - The processor for handling session requests. - **External Database Reference ID** (string) - Required - A unique identifier for the external database. ``` -------------------------------- ### Run FaceTec Browser SDK Server Source: https://dev.facetec.com/getting-started Execute this command to start the server for the FaceTec browser SDK sample app. Navigate to localhost:8000 if your browser does not open automatically. ```bash npm run facetec-browser-sdk ``` -------------------------------- ### FaceTec Usage Log Format Example Source: https://dev.facetec.com/usage-logs This is an example of the Usage Log format for a 3D Liveness Check. These logs are sent to FaceTec for billing and statistical analysis. ```text FTL,A:[MACHINE ID],C:[DEVICE LICENSE KEY],D:[TIMESTAMP],E:[ANTI-TAMPERING HASH],F:[INSTALLATION ID 1],J:[TRANSACTION TYPE],K:[FACETEC SERVER VERSION],L:[FACETEC SERVER VERSION FOR 3D FACESCAN/MAP 1],N:[DEVICE SDK PLATFORM FOR 3D FACESCAN/MAP 1],P:[PACKAGE ID/BUNDLE ID/DOMAIN 1],V:[LIVENESS RESULT FOR 3D FACESCAN/MAP 1],X:[ENCRYPTED SESSION DATA 1],R:[EXTRA RESULT INFO],S:[SUCCESSFUL OR NOT SUCCESSFUL],LTF ``` -------------------------------- ### Rebuild 1:N Search DB with Batch Enrollment (Java) Source: https://dev.facetec.com/1-to-n-search Demonstrates rebuilding a 1:N Search Database by re-enrolling FaceMaps in batches. It includes handling potential algorithm update exceptions and iterating through existing enrollments from a MongoDB collection. ```java FaceTecSDKInstance faceTecSDKInstance = initSuccessfullyProduction(); try { // Attempt to load your 3D-3D persisted search group. FaceTec3D3DSearchGroup searchGroup = faceTecSDKInstance.create3D3DPersistedSearchGroup("/Path/To/Old/Persisted/Search/Group"); } catch (FaceTecPersistedSearchException e) { // It will fail with the following exception. FaceTecPersistedSearchException.Error.MUST_RECREATE_SEARCH_DB_DUE_TO_ALGORITHM_UPDATE; // You will need to re-enroll all the FaceMaps in this persisted search group. } try { // Create your new persisted search group. FaceTec3D3DSearchGroup persistedSearchGroup = faceTecSDKInstance.create3D3DPersistedSearchGroup("/Path/To/New/Persisted/Search/Group"); // Create a HashMap to hold your enrollments. HashMap faceMapsToEnroll = new HashMap<>(); // Get your collection of FaceMaps to re-enroll. FindIterable findIterable = MongoClient.getDb().getCollection("EnrolledFaceMaps").find(); final int numberOfFaceMapsToBatchEnrollAtOnce = 1000; for(Document doc : findIterable) { String enrollmentId = doc.getString("enrollmentID"); String base64EncodedFaceMap = doc.getString("base64EncodedFaceMap"); byte[] faceMapBytes = Base64.getDecoder().decode(base64EncodedFaceMap); // Add the FaceMap into the Map with it's enrollment Identifier. faceMapsToEnroll.put(enrollmentId, faceMapBytes); if(faceMapsToEnroll.size() >= numberOfFaceMapsToBatchEnrollAtOnce) { // Call batch enrollment to re-enroll this subset of FaceMaps. persistedSearchGroup.enroll3D_3D_DB_Batched(faceMapsToEnroll); faceMapsToEnroll.clear(); } } // call batch enrollment on any remaining FaceMaps. persistedSearchGroup.enroll3D_3D_DB_Batched(faceMapsToEnroll); } catch (Exception e) { System.out.println(e.getMessage()); } ``` -------------------------------- ### Configuration for Search Database Initialization Source: https://dev.facetec.com/1-to-n-search This snippet shows how to enable the Search Database initialization on startup within the config.yaml file. ```APIDOC ## Configuration In **config.yaml**, configure the FaceTec Server to initialize the Search Database on startup: ```yaml # ------------------------------------- # Search Options # ------------------------------------- # REQUIRED # true will initialize Search Database on startup, and fail to start if # false will not initialize the Search endpoints for this Server Instance. # DEVELOPER NOTE: Please read the Search Guide prior to getting started with Search. The FaceTec Server provides # basic functionality but does not ensure Databases are syncd or Search works as expected if using a Cluster. enableSearch: true ``` To enable Fraud List Search and Account Deduplication, please see the Enable Fraud List Search & Account Deduplication Guide. ``` -------------------------------- ### Install Node Version Manager and NodeJS on Amazon Linux AMI Source: https://dev.facetec.com/standard-server-and-dashboard Installs Node Version Manager (nvm) and the latest version of NodeJS. These commands are for Amazon Linux AMI and may differ for other operating systems. ```bash curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash ``` ```bash . ~/.nvm/nvm.sh ``` ```bash nvm install node ``` -------------------------------- ### Initialize 3D-DB for Search Source: https://dev.facetec.com/1-to-n-search Initialize your 3D-DB by providing the path to your 3D-DB directory to the createPersistedSearchGroup method. This will load an on-disk 3D-DB or start a new one if it does not exist. ```java FaceTecSDKInstance facetecInstance = …; String databaseDirectory = "/path/to/load/search/database/from"; // Load an on-disk 3D-DB or start a new one if it doesn't exist FaceTecSearchGroup mySearchGroup = facetecInstance.createPersistedSearchGroup(databaseDirectory); ``` -------------------------------- ### 3D-DB Get Source: https://dev.facetec.com/api-call-list Checks if a 3D FaceMap exists in the 3D-DB. ```APIDOC ## 3D-DB Get ### Description Checks if the 3D FaceMap exists in the 3D-DB. ### Method GET ### Endpoint /3d-db/get ### Parameters #### Query Parameters - **externalDatabaseReferenceID** (string) - Required - An identifier for the external database. - **groupName** (string) - Required - The name of the group to check within. ### Response #### Success Response (200) - **Success** (boolean) - Indicates if the FaceMap exists. #### Response Example { "success": true } ``` -------------------------------- ### Start ID Scanning Source: https://dev.facetec.com/api-call-list Initiates an ID Scanning Session on the Device SDK. ```APIDOC ## Start ID Scanning ### Description Starts an ID Scanning Session on the Device SDK. ### Method `startIDScanOnly` ### Parameters #### Core Inputs - **Session Request Processor** (object) - Required - The processor for handling session requests. - **External Database Reference ID** (string) - Required - A unique identifier for the external database. ``` -------------------------------- ### GET /enrollment-3d/:externalDatabaseRefID Source: https://dev.facetec.com/api-guide Retrieves an Enrolled 3D FaceMap using its unique externalDatabaseRefID. ```APIDOC ## GET /enrollment-3d/:externalDatabaseRefID ### Description Retrieve an Enrolled 3D FaceMap. See Using externalDatabaseRefID in API Calls (HTTPS API). ### Method GET ### Endpoint /enrollment-3d/:externalDatabaseRefID ### Parameters #### Path Parameters - **externalDatabaseRefID** (String) - Required - The unique identifier for the enrolled FaceMap. ### Response - **success** (Boolean) - Indicates if the retrieval was successful. - **faceMapBase64** (Base64) - The Base64 encoded 3D FaceMap. - **auditTrailBase64** (Base64) - The Base64 encoded audit trail image. ``` -------------------------------- ### GET /status Source: https://dev.facetec.com/api-guide Retrieves basic information about the FaceTec Server's operational status. ```APIDOC ## GET /status ### Description Retrieves basic information about the FaceTec Server. ### Method GET ### Endpoint /status ### Parameters None ### Core Response Properties - **running** (Boolean) - Indicates if the server is running. - **success** (Boolean) - Indicates if the request was successful. - **error** (Boolean) - Indicates if an error occurred. - **serverInfo** (JSON String) - Contains FaceTec Server Version, Type, and Mode. ```