Skip to content

fingerprintjs/fastly-vcl-proxy

Repository files navigation

Fingerprint logo

Current version MIT license Discord server

Fingerprint Pro Fastly VCL Proxy Integration

Fingerprint is a device intelligence platform offering industry-leading accuracy.

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
  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 Fingerprint from '@fingerprint/agent'
    
    const fp = Fingerprint.start({
      endpoints: ['https://yourwebsite.com/INTEGRATION_PATH?region=us'],
      apiKey: 'PUBLIC_API_KEY',
      region: 'us'
    });

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/fastly-vcl-proxy
  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
    • --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.