
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@d11/react-native-impression-tracker
Advanced tools
A lightweight React Native SDK for tracking impressions of screen elements. This library allows developers to track when specific components or views are visible on the screen, enabling precise measurement of user engagement with banners, ads, or other co
A lightweight, flexible React Native library for tracking view-based impressions and user interactions across all types of layouts — including scrollable views, static screens, tabs, carousels, and deeply nested subcomponents.
npm install react-native-impression-tracker
# or
yarn add react-native-impression-tracker
import React from 'react';
import { Text, View, ScrollView } from 'react-native';
import ImpressionTracker, {
AdsClickedInterface,
} from 'react-native-impression-tracker';
const ExampleScreen = () => {
const handleImpression = () => {
console.log('Element became visible for long enough!');
};
const handleClick = (params: AdsClickedInterface) => {
console.log('Ad clicked:', params);
};
return (
<ScrollView>
<ImpressionTracker
onImpressionTrigger={handleImpression}
onRealEstateClicked={handleClick}
desiredImpressionTime={1000} // in ms
desiredImpressionViewability={0.5} // 50% of component visible
>
<View style={{ height: 200, backgroundColor: 'lightblue' }}>
<Text>Track Me</Text>
</View>
</ImpressionTracker>
</ScrollView>
);
};
export default ExampleScreen;
<ImpressionTracker />Wrap any component to track its visibility and user interaction.
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Elements to be wrapped and tracked. |
rootMargin | { top?: number; bottom?: number; left?: number; right?: number; } | {} | Optional margins around the view to adjust visibility bounds. |
desiredImpressionViewability | number | 0.5 | Portion (0–1) of the component that must be visible to count as an impression. |
desiredImpressionTime | number | 1000 | Time in milliseconds the component must remain visible to trigger impression. |
onImpressionTrigger | () => void | — | Callback fired after viewability and dwell time conditions are met. |
onRealEstateClicked | (params: AdsClickedInterface) => void | — | Callback fired when the user interacts (clicks/taps) on the tracked area. |
style | ViewStyle |
useImpressionTrackerThe useImpressionTracker hook provides access to the handleClickForImpression function via context, allowing child components inside an <ImpressionTracker> to manually report click interactions tied to impression data.
<ImpressionTracker> provider.handleClickForImpression, which you can call with custom parameters (like ad ID, position, etc.).import React from 'react';
import { TouchableOpacity, Text } from 'react-native';
import { useImpressionTracker } from 'react-native-impression-tracker';
const AdTile = () => {
const { handleClickForImpression } = useImpressionTracker();
return (
<TouchableOpacity
onPress={() => handleClickForImpression({ adId: 'banner-001', position: 3 })}
>
<Text>Click Me</Text>
</TouchableOpacity>
);
};
This project uses:
To run all tests:
yarn test
# or
npm test
Join the DreamSportsLabs Community to chat about flash-client or other DreamSportsLabs libraries.
DreamSportsLabs is committed to building open-source tools that empower developers and businesses. Learn more about us at our website.
Pull requests and contributions are welcome!
To contribute:
Fork the repository.
Create a new branch for your feature or bug fix:
git checkout -b feature/my-awesome-feature
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A lightweight React Native SDK for tracking impressions of screen elements. This library allows developers to track when specific components or views are visible on the screen, enabling precise measurement of user engagement with banners, ads, or other co
We found that @d11/react-native-impression-tracker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
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.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.