<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel rdf:about="https://dwt.life/feed/rss/tag/fingerprintjs/">
<title>dwt&#039;s life - fingerprintjs</title>
<link>https://dwt.life/tag/fingerprintjs/</link>
<description></description>
<items>
<rdf:Seq>
<rdf:li resource="https://dwt.life/archives/186/"/>
</rdf:Seq>
</items>
</channel>
<item rdf:about="https://dwt.life/archives/186/">
<title>fingerprintjs pro接入指南</title>
<link>https://dwt.life/archives/186/</link>
<dc:date>2022-01-29T00:31:21+08:00</dc:date>
<description>接入npm install @fingerprintjs/fingerprintjs-pro或&lt;script&gt;
  // Initialize the agent at application startup.
  const fpPromise = new Promise((resolve, reject) =&gt; {
    const script = document.createElement(&#039;script&#039;)
    script.onload = resolve
    script.onerror = () =&gt; reject(&#039;Failed to load the script&#039;)
    script.async = true
    script.src = &#039;https://cdn.jsdelivr.net/npm/&#039;
      + &#039;@fingerprintjs/fingerprintjs-pro@3/dist/fp.min.js&#039;
    document.head.appendChild(script)
  })
    .then(() =&gt; FingerprintJS.load({
      // Get a token at https://dashboard.fingerprintjs.com
      // Wait a couple of seconds before a result appears
      token: &#039;sample_docs_token&#039;,
      // region: &#039;eu&#039;,
      // endpoint: &#039;https://fp.your.com&#039;,
    }))

  // Get the visitor identifier when you need it.
  fpPromise
    .then(fp =&gt; fp.get(
      /* { linkedId: &#039;your-linked-id&#039;, tag: { yourTag: 123456 } } */
    ))
    .then(result =&gt; {
      const visitorId = result.visitorId
      console.log(&#039;Your visitorId:&#039;, visitorId)
    })
    .catch(error =&gt; console.error(error))
&lt;/script&gt;npm接入代码：import FingerprintJS from &#039;@fingerprintjs/fingerprintjs-pro&#039;

// Initialize an agent at application startup.
const fpPromise = FingerprintJS.load({
  token: &#039;sample_docs_token&#039;,
  region: &#039;eu&#039; //ap eu 
})

// Get the visitor identifier when you need it.
fpPromise
  .then(fp =&gt; fp.get())
  .then(result =&gt; console.log(result.visitorId))服务端检查用户visitorId:https://api.fpjs.io/visitors/someVisitorID?token=token其中，https://eu.api.fpjs.io for EUhttps://ap.api.fpjs.io for Asia (Mumbai)用户标注使用tag和link-id区分，tag分组，link-id细分uidimport FingerprintJS from &#039;@fingerprintjs/fingerprintjs-pro&#039;

// Initialize an agent at application startup.
const fpPromise = FingerprintJS.load({ token: &#039;token&#039; })

// Get the visitor identifier when you need it.
fpPromise
  .then(fp =&gt; fp.get({ linkedId: &#039;your-linked-id&#039;, tag: { yourTag: 123456 } }))
  .then(result =&gt; console.log(result.visitorId))&lt;script&gt;
  // Initialize the agent at application startup.
  const fpPromise = new Promise((resolve, reject) =&gt; {
    const script = document.createElement(&#039;script&#039;);
    script.onload = resolve;
    script.onerror = reject;
    script.async = true;
    script.src = &#039;https://cdn.jsdelivr.net/npm/&#039;
      + &#039;@fingerprintjs/fingerprintjs-pro@3/dist/fp.min.js&#039;;
    document.head.appendChild(script);
  }).then(() =&gt;
    FingerprintJS.load({ token: &#039;&#039; })
  );

  // Get the visitor identifier when you need it.
  fpPromise
    .then(fp =&gt; fp.get({ linkedId: &#039;your-linked-id&#039;, tag: { yourTag: 123456 }})
    .then(result =&gt; console.log(result.visitorId));
&lt;/script&gt;自定义数据上报域名有时候adblock可能会屏蔽fp的域名，我们可以在后台自定义域名（需要申请ssl）按要求先解析cname过去，然后耐心等待SSL签发，检测很快就会通过。出来两个亚马逊BGP的IP，并告诉我们如何指定endpoint：FingerprintJS.load({token: &#039;&#039;, endpoint: &#039;https://endpoint&#039;})暂时更新这么多， fingerprintjspro的dashboard bug真不少，之前注册接入域名的时候卡住了，提交不了。后续从激活链接点入的就可以了，不过界面做的还倒是不错。</description>
</item>
</rdf:RDF>