Skip to content

Fingerprint Pro Fastly VCL Integration is responsible for proxying identification and JavaScript agent download requests that are performed on your Fastly infrastructure.

License

Notifications You must be signed in to change notification settings

fingerprintjs/fingerprint-pro-fastly-vcl-integration

Repository files navigation

Fingerprint logo

Current version MIT license Discord server

Fingerprint Pro Fastly VCL Proxy Integration

Fingerprint is a device intelligence platform offering 99.5% accurate visitor identification.

Fingerprint Fastly VCL Proxy Integration is responsible for proxying identification and agent-download requests between your website and Fingerprint through your Fastly infrastructure via VCL. The integration consists of a custom VCL file you can add to your Fastly CDN Service.

🚧 Requirements and expectations

  • Limited to Enterprise plan: The Fastly VCL Proxy Integration is exclusively supported for customers on the Enterprise Plan. Other customers are encouraged to use Custom subdomain setup or Cloudflare Proxy Integration.

  • Manual updates occasionally required: The underlying data contract in the identification logic can change to keep up with browser updates. Using the Fastly VCL Proxy Integration might require occasional manual updates on your side. Ignoring these updates will lead to lower accuracy or service disruption.

Getting started

This is a quick overview of the installation setup. For detailed step-by-step instructions, see the Fastly VCL proxy integration guide in our documentation.

  1. Go to Fingerprint Dashboard > API Keys and click Create Proxy Key to create a proxy secret. You will use it later to authenticate your requests to Fingerprint APIs.

  2. Create a Dictionary in your Fastly CDN Service named fingerprint_config and add the following values:

    Key Example Value Description
    PROXY_SECRET 6XI9CLf3C9oHSB12TTaI Fingerprint proxy secret generated in Step 1
    INTEGRATION_PATH 02mbd3 Random path prefix for proxy integration endpoints
    AGENT_SCRIPT_DOWNLOAD_PATH z5kms2 Random path segment for downloading the JS agent
    GET_RESULT_PATH nocmjw Random path segment Fingerprint identification requests
  3. Go to Releases to download the latest fingerprint-pro-fastly-vcl-integration.vcl template file.

  4. Paste the template file contents to your Fastly CDN Service's Custom VCL.

  5. Configure the Fingerprint JS Agent on your website using the paths defined in Step 2.

    import * as FingerprintJS from '@fingerprintjs/fingerprintjs-pro'
    
    const fpPromise = FingerprintJS.load({
      apiKey: 'PUBLIC_API_KEY',
      scriptUrlPattern: [
        'https://yourwebsite.com/INTEGRATION-PATH/AGENT_SCRIPT_DOWNLOAD_PATH?apiKey=<apiKey>&version=<version>&loaderVersion=<loaderVersion>',
        FingerprintJS.defaultScriptUrlPattern, // Fallback to default CDN in case of error
      ],
      endpoint:
        'https://yourwebsite.com/INTEGRATION-PATH/GET_RESULT_PATH?region=us',
        FingerprintJS.defaultEndpoint // Fallback to default endpoint in case of error
      ],
    });

See the Fastly VCL proxy integration guide in our documentation for more details.

Customizing the template

If you need to customize the template configuration, you can clone this repository and build the template locally with custom parameters.

  1. Clone the repository: git clone https://github.com/fingerprintjs/fingerprint-pro-fastly-vcl-integration
  2. Run pnpm install
  3. Build the VCL file with pnpm build
    • --config-table-name (Optional, default: fingerprint_config): Identifier name for Fastly VCL's dictionary to store Fingerprint related variables
    • --fpcdn-domain (Optional, default: fpcdn.io): Domain to request agent script from
    • --fpjs-domain (Optional, default: api.fpjs.io): Domain to make user identification requests
    • --max-connections (Optional, default: 200): Fastly CDN Service maximum number of requests per second limit for each origin
  4. Copy dist/fingerprint-pro-fastly-vcl-integration.vcl file's contents.
  5. Paste contents to your Fastly CDN Service's Custom VCL.

If you have any questions, reach out to our support team.

License

This project is licensed under the MIT license.