Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@schibsted/niche-ads
Advanced tools
This repository contains code we use for appnexus ads. Given the right config it can request and return ready to display appnexus ads. It is possible to pass configuration for ads different than appnexus but in that case you will get back your config. It was added to enable using this libary for mixed appnexus and different ads. If you don't use appnexus ads then this library is not for you!
First install dependencies clone repository, open terminal and run.
npm ci
Next start transpiling the source code:
npm run transpile:watch
Note: order of command execution is important.
In order to make your project available as package locally:
npm link
And in project you need:
npm link @schibsted/niche-ads
Since library has react
as peer dependency you need to make sure to pass react
manually to the library if you want to use linked version. The easiest way to do so is to declare react
as a webpack alias, e.g.
config.resolve.alias.react = path.resolve("./node_modules/react");
And now you are all good. Your project will now use the local version of niche-ads instead of the one in node_modules.
After you end working on the package you need to unlink it.
First, in the project where the package was used:
npm unlink --no-save @schibsted/niche-tracking
Second, in the niche-tracking package:
npm unlink
Package exports 4 entities AdContext
, AdContextProvider
, usePlacement
, useLoadAds
.
Ideally you won't ever need to use this directly. It may be usefull for debugging or to peek what the library is storing under the hood. Ideally you should use AdContextProvider
.
Ideally you should wrap your application with AdContextProvider
quite close to the start of your application.
Minimal usage example:
import { AdContextProvider } from "@schibsted/niche-ads";
function SomeComponent({ children, adsConfig, device }) {
return (
<AdContextProvider adsConfig={publicRuntimeConfig.ads} device={device}>
{children}
</AdContextProvider>
);
}
export default SomeComponent;
desktop
, tablet
, mobile
disablePsa
or enableSafeFrame
https://acdn.adnxs.com/ast/ast.js
https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js
false
false
{
options: {
member: 9700, // 9700 - regular member, 9826 - test seat
disablePsa: true,
enableSafeFrame: true,
},
placements: {
common: {
noBidIfUnsold: true, // will be passed to all placements
},
desktop: {
other: [ // different type of pages, usually article, front and other are used
{
targetId: 'advert-topboard',
invCode: 'no-pent-wde-other_topboard',
sizes: [
[1010, 300],
[1010, 150],
[980, 300],
[980, 150],
[1000, 150],
],
alwaysUseXDomainIframe: true,
keywords: {
'no-sno-adformat': 'topboard',
},
},
],
},
tablet: {
other: [
{
targetId: 'advert-topboard',
invCode: 'no-pent-wtb-other_topboard',
sizes: [
[980, 300],
[980, 250],
[768, 250],
],
keywords: {
'no-sno-adformat': 'topboard',
},
},
],
},
mobile: {
other: [
{
targetId: 'advert-board_1',
invCode: 'no-pent-wph-front_board_1',
sizes: [
[320, 250],
[300, 250],
[320, 400],
],
keywords: {
'no-sno-adformat': 'board_1',
},
},
],
},
},
keywords: {
common: {
'aa-sch-country_code': 'no',
'aa-sch-publisher': 'pent',
'no-sno-publishergroup': 'schibsted',
'aa-sch-inventory_type': 'other',
'aa-sch-page_type': 'other',
},
desktop: {
common: {
'aa-sch-supply_type': 'web_desktop',
},
},
tablet: {
common: {
'aa-sch-supply_type': 'web_tablet',
},
},
mobile: {
common: {
'aa-sch-supply_type': 'web_phone',
},
},
},
}
setWallpaperFunction
const setWallpaper = (url) => {
document.body.style.backgroundImage = `url(${url})`;
document.body.style.backgroundRepeat = "no-repeat";
document.body.style.backgroundAttachment = "fixed";
};
setBackgroundColour
export const setBackgroundColour = (colour) => {
document.body.style.backgroundColor = colour;
};
FAQs
Package containing ads logic reappearing across our projects
The npm package @schibsted/niche-ads receives a total of 2 weekly downloads. As such, @schibsted/niche-ads popularity was classified as not popular.
We found that @schibsted/niche-ads demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.