For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integration

This guide provides detailed step-by-step instructions for installing and integrating the SDK Loader into your application. For an overview of the concepts and prerequisites, see the Quick Start.

Installation

Note: Before continuing, make sure you meet the prerequisites and have your authentication token ready.

Configure the NPM registry

The SDK Loader package is hosted in a private NPM repository. Create a file .npmrc in the root of your project with the following configuration:

@facephi:registry=https://facephicorp.jfrog.io/artifactory/api/npm/sdk-web-fphi/
//facephicorp.jfrog.io/artifactory/api/npm/sdk-web-fphi/:_password=[YOUR_TOKEN]
//facephicorp.jfrog.io/artifactory/api/npm/sdk-web-fphi/:username=[YOUR_USERNAME]
//facephicorp.jfrog.io/artifactory/api/npm/sdk-web-fphi/:email=[YOUR_EMAIL]
//facephicorp.jfrog.io/artifactory/api/npm/sdk-web-fphi/:always-auth=true

Replace [YOUR_TOKEN], [YOUR_USERNAME] and [YOUR_EMAIL] with the credentials provided by Facephi.

Install the package

Install the SDK Loader with your preferred package manager:

npm install @facephi/sdk-loader

Note: Other managers such as Bun or Yarn can also be used.


Integration steps

1

Create a container element

Add a container element in your HTML or component where the SDK will be rendered:

2

Initialize the SDK

Import and call loadSdk with your configuration:

3

Manage SDK events

Listen to the events emitted by the SDK:

For more SDK configuration options, see the section SDK Configuration below.


Complete example (React + Vite)

Here is a complete example of a basic integration with React and Vite:

App.tsx:


Development server

Run the development server:

Go to http://localhost:3000/. The application will automatically reload if you modify any of the source files.


Build

Generate the project build for production:

The build artifacts will be saved in the dist/.


Framework integrations

The SDK Loader can be integrated into any modern framework. For framework-specific guides:


Next steps

Last updated