Skip to content

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

License

Notifications You must be signed in to change notification settings

fingerprintjs/fingerprint-pro-akamai-proxy-integration

Repository files navigation

Fingerprint logo

Current version MIT license Discord server

Warning

This integration is in Beta

Fingerprint Pro Akamai Proxy Integration

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

Fingerprint Akamai Proxy Integration is responsible for proxying identification and agent-download requests between your website and Fingerprint through your Akamai infrastructure. The integration consists of a set of property rules you need to add to your Akamai property configuration. The property rules template is available in this repository.

🚧 Requirements and expectations

  • Integration in Beta: Please report any issues to our support team.

  • Limited to Enterprise plan: The Akamai Proxy Integration is accessible and 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 Akamai Proxy Integration might require occasional manual updates on your side. Ignoring these updates will lead to lower accuracy or service disruption.

How to install with Terraform

Note

This section assumes you use Terraform to manage your site infrastructure on Akamai and that your site uses the latest Akamai rule format.

This is a quick overview of the installation setup. For detailed step-by-step instructions, see the Akamai 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. Add the following variable blocks to the Akamai property Rules template in your Terraform configuration file. If you are using a plain JSON file instead of a rules template, reach out to our support team.

    # main.tf
    data "akamai_property_rules_template" "rules" {
          # Assuming this is property's rules file
          template_file = "/rules/main.json" 
          variables {
            name  = "fpjs_integration_path"
            value = "YOUR_INTEGRATION_PATH_HERE" # any random string that's a valid URL
            type = "string"
          }
          variables {
            name  = "fpjs_agent_path"
            value = "YOUR_AGENT_PATH_HERE" # any random string that's a valid URL
            type = "string"
          }
          variables {
            name  = "fpjs_result_path"
            value = "YOUR_RESULT_PATH_HERE" # any random string that's a valid URL
            type = "string"
          }
          variables {
            name  = "fpjs_proxy_secret"
            value = "YOUR_PROXY_SECRET_HERE" # Use the proxy secret from the previous step
            type = "string"
          }
    }
  3. Go to this repository latest releases and download these two JSON files:

    • terraform/fingerprint-property-rules.json
    • terraform/fingerprint-property-variables.json
  4. Add the files to the rules directory of your Terraform project.

  5. Reference the files inside your rules/main.json file:

    // rules/main.json
    {
      "rules": {
        "name": "default",
        "behaviors": [
          // ...
        ],
        "children": [
          //...
          // Add the downloaded rules file as a child
          "#include:fingerprint-property-rules.json" 
        ],
        // Add the downloaded variables file (or merge it with existing variables file)
        "variables": "#include:fingerprint-property-variables.json"
        // ...
      }
    }
  6. Run terraform plan to review your changes and terraform apply to deploy them.

  7. 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/YOUR_INTEGRATION_PATH_HERE/YOUR_AGENT_PATH_HERE?apiKey=<apiKey>&version=<version>&loaderVersion=<loaderVersion>',
        FingerprintJS.defaultScriptUrlPattern, // Fallback to default CDN in case of error
      ],
      endpoint: 
        'https://yourwebsite.com/YOUR_INTEGRATION_PATH_HERE/YOUR_RESULT_PATH_HERE?region=us',
        FingerprintJS.defaultEndpoint // Fallback to default endpoint in case of error
      ],
    });

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

Building property rules for Terraform locally

If you prefer, you can clone this repository and build the property rules and variables locally.

  1. Run pnpm install.
  2. Run pnpm build --type terraform. It will generate the following files you can use in your Terraform configuration as described above.
  • dist/terraform/json/fingerprint.json
  • dist/terraform/json/variables.json
  • dist/terraform/example.tf

The JSON files are equivalent to the JSON files available in the latest releases.

How to install using Akamai Property Manager API (without Terraform)

You can clone this repository and build the property rules locally into a single body.json file. You can then apply them as a patch update to your property configuration using Akamai Property Manager API. This allows you to install the integration in an automated way even if you do not use Terraform.

  1. Run pnpm install.
  2. Run pnpm build --type patchBody --integration-path YOUR_INTEGRATION_PATH_HERE --agent-path YOUR_AGENT_PATH_HERE --result-path YOUR_RESULT_PATH_HERE --proxy-secret YOUR_PROXY_SECRET_HERE.
    • Use the same values you would use in Step 2 if you were installing with Terraform.
    • The command generates a dist/patch-body/body.json file. This file includes all rules and property variables necessary for the integration.
  3. Use the Patch a property's rule tree endpoint of the Akamai Property Manager API to apply the generated JSON to your Akamai property.

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

License

This project is licensed under the MIT license. See the LICENSE file for more info.