fix: JS agent installed from jsDelivr makes a network request to fpnpmcdn.io that can be blocked by your Content Security Policy. This is a temporary fix, it will be reverted. Please switch to our CDN to avoid this problem in future.
A new CDN for the CDN installation methods. Follow this guide to update. The old CDN URLs pointing to jsDelivr continue working, but we recommend switching to our CDN to avoid excess network requests.
JS agent installed from NPM loads its code from our CDN in runtime. It guarantees that you always use the latest and the most accurate version of JS agent.
If you use a Content Security Policy, add the CDN domain to the CSP as described here (see the "NPM installation" tab).
If you do an HTML preconnect, consider preconnecting to the CDN too as described here (see the "NPM installation" tab).
fix: If your project uses TypeScript and has the TypeScript's isolatedModules option is enabled, JS agent causes an error: "TS2748: Cannot access ambient const enums"
Rename the token option of the load method of JS agent to apiKey. The token option keeps working for backward compatibility. Also rename some error constants (the old names work too):
ERROR_TOKEN_MISSING → ERROR_API_KEY_MISSING
ERROR_TOKEN_INVALID → ERROR_API_KEY_INVALID
ERROR_TOKEN_EXPIRED → ERROR_API_KEY_EXPIRED
fix: JavaScript agent triggers a console error message unless the page's Content Security Policy allows unsafe-inline for style-src
Improve incognito mode detection accuracy in Safari
Deprecate the ipResolution parameter because it affects nothing
The get() result's ipLocation field is marked is optional in the TypeScript declaration. The field could be undefined in fact, so this is a fix of the type declaration.