Fingerprint is a device intelligence platform offering 99.5% accurate visitor
identification. Fingerprint Pro React Native SDK is an easy way to integrate Fingerprint Pro into your React Native
application to call the native Fingerprint Pro libraries (Android and iOS) and identify devices.
Use the useVisitorData hook in your components to perform visitor identification and get the data.
// src/App.jsimportReact, { useEffect } from'react';
import { Text } from'react-native';
import { useVisitorData } from'@fingerprintjs/fingerprintjs-pro-react-native';
functionApp() {
const {
isLoading,
error,
data,
getData,
} = useVisitorData();
useEffect(() => {
getData();
}, []);
if (isLoading) {
return<Text>Loading...</Text>;
}
if (error) {
return<Text>An error occured: {error.message}</Text>;
}
if (data) {
// perform some logic based on the visitor datareturn (
<Text>
Visitor id is {data.visitorId}
</Text>
);
} else {
returnnull;
}
}
exportdefaultApp;
API Client approach
importReact, { useEffect } from'react';
import { FingerprintJsProAgent } from'@fingerprintjs/fingerprintjs-pro-react-native';
// ... useEffect(() => {
asyncfunctiongetVisitorInfo() {
try {
constFingerprintClient = newFingerprintJsProAgent({ apiKey: 'PUBLIC_API_KEY', region: 'eu' }); // Region may be 'us', 'eu', or 'ap'const visitorId = awaitFingerprintClient.getVisitorId(); // Use this method if you need only visitorIdconst visitorData = awaitFingerprintClient.getVisitorData(); // Use this method if you need additional information about visitor// use visitor data in your code
} catch (e) {
console.error('Error: ', e);
}
}
getVisitorInfo();
}, []);
extendedResponseFormat
Two types of responses are supported: "default" and "extended". You don't need to pass any parameters to get the "default" response.
"Extended" is an extended result format that includes geolocation, incognito mode and other information.
It can be requested using the extendedResponseFormat: true parameter. See more details about the responses in the documentation.
Providing extendedResponseFormat with hooks approach
Providing extendedResponseFormat with API Client approach
constFingerprintClient = newFingerprintJsProAgent({ apiKey: 'PUBLIC_API_KEY', region: 'eu', extendedResponseFormat: true }); // Region may be 'us', 'eu', or 'ap'// =================================================================================================^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LinkedId and tags
linkedId is a way of linking current analysis event with a custom identifier. This will allow you to filter visit information when using the Server API
For more information, see Linked ID.
tag is a customer-provided value or an object that will be saved together with the analysis event and will be returned back to you in a webhook message or when you search for the visit in the server API.
For more information, see Tag.
Providing linkedId and tags with API Client approach
const { getData } = useVisitorData();
const tags = {
tag1: 'string tag',
tag2: 42,
tag3: true,
tag4: [0, 1, 1, 2, 5],
tag5: { foo: 'bar' }
};
const linkedId = 'custom id';
const visitorId = awaitFingerprintClient.getVisitorId(tags, linkedId); // Use this method if you need only visitorIdconst visitorData = awaitFingerprintClient.getVisitorData(tags, linkedId); // Use this method if you need additional information about visitor
Official React Native client for Fingerprint PRO. Best identification solution for React Native.
The npm package @fingerprintjs/fingerprintjs-pro-react-native receives a total of 3,740 weekly downloads. As such, @fingerprintjs/fingerprintjs-pro-react-native popularity was classified as popular.
We found that @fingerprintjs/fingerprintjs-pro-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 3 open source maintainers collaborating on the project.
Last updated on 28 Mar 2024
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.