
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
react-tads-widget
Advanced tools
A React component for displaying ads using https://tads.me/
npm install react-tads-widget
import { TadsWidgetProvider } from 'react-tads-widget';
root.render(
<React.StrictMode>
<TadsWidgetProvider>
<App />
</TadsWidgetProvider>
</React.StrictMode>
);
import React from "react";
import { TadsWidget } from 'react-tads-widget';
const PageWithAds: React.FC = () => {
const rewardUserByClick = () => {
console.log("User rewarded for click");
};
const onAdsNotFound = () => {
console.log("Not found ads for this user");
}
return (
<div className="container">
<TadsWidget id="unique-widget-id" type="static" debug={false} onClickReward={rewardUserByClick} onAdsNotFound={onAdsNotFound} />
</div>
);
}
export default PageWithAds;
import React from "react";
import { TadsWidget, renderTadsWidget } from 'react-tads-widget';
const PageWithAds: React.FC = () => {
const rewardUserByShow = () => {
console.log("User rewarded for impression");
};
const onAdsNotFound = () => {
console.log("Not found ads for this user");
}
const showFullScreen = () => {
renderTadsWidget({ id: 'unique-widget-id', type: 'fullscreen' })
}
return (
<div className="container">
<button onClick={showFullScreen}>SHOW FULLSCREEN</button>
<TadsWidget id="unique-widget-id" type="fullscreen" debug={false} onAdsNotFound={onAdsNotFound} onShowReward={rewardUserByShow} />
</div>
);
}
export default PageWithAds;
Param | Type | Default | Description | |
---|---|---|---|---|
id | required | string | Your widget id, which you get from your personal account | |
type | required | string | static | Type of your widget. It can be 'static', 'fullscreen', etc. See docs to check all available types. |
debug | optional | boolean | false | flag which you can use for development mode (it doesn't collect data in your ads account and doesn't request real ads) |
onShowReward | optional | function | null | callback which will be called after user watches ad |
onClickReward | optional | function | null | callback which will be called after user clicks ad |
onAdsNotFound | optional | function | null | callback which will be called if we don't find ads for user |
Read more about integration in our docs for publisher https://docs.tads.me/getting-started/publishers
FAQs
A React component for displaying ads using tAds
The npm package react-tads-widget receives a total of 330 weekly downloads. As such, react-tads-widget popularity was classified as not popular.
We found that react-tads-widget demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.