API preconnect

Performance tip

API preconnect is recommended for improved request timings. To enable it, place the preconnect directive as early as possible in your head tag:

<html>
<head>
  <link rel="preconnect" href="https://fpcdn.io">
  <link rel="preconnect" href="https://api.fpjs.io">
  ... styles, js etc
<html>
<head>
  <link rel="preconnect" href="https://fpnpmcdn.net">
  <link rel="preconnect" href="https://api.fpjs.io">
  ... styles, js etc

Note that you always need to preconnect to api.fpjs.io.

  • If you're using the EU API, use this preconnect URL: https://eu.api.fpjs.io.
  • If you're using the Mumbai API, use this preconnect URL: https://ap.api.fpjs.io
  • If you're using the Custom subdomain, use your subdomain in the preconnect, instead of https://api.fpjs.io

Example with the Custom subdomain enabled on https://fp.mydomain.com:

<html>
<head>
  <!-- only if you load the script from the CDN -->
  <link rel="preconnect" href="https://fpcdn.io">
  <link rel="preconnect" href="https://fp.mydomain.com">