![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@roast-cms/links
Advanced tools
links
An Express.js server middleware for managing affiliate links.
This project creates an API service which will return a link URL in response to a keyword (or another URL) and parameters (like locale). You can use the returned URL to either create redirects (link cloaking) or to simply manage links the HTML of your blog, website, or a tool.
.env
file in your root dir with a random APPLICATION_SECRET
string & connection URIs (see .env.example
).yarn add @roast-cms/links
import links from "@roast-cms/links";
app.use(
links({
// OPTIONAL path name for the `links` API on local Express router
pathName: "/recommends",
})
);
Complete example can be found in ./example-server.ts
and can be run with yarn dev:example
from this repo.
/recommends/widget
{
"link": "widget",
"status": 200,
"vendor": {
"name": "eBay",
"url": "https://ebay.com/us/widget?referral=you"
}
}
For this example to work, MongoDB collection links
should have the following document (vendors[].locale
is optional):
{
"link": "widget",
"vendors": [
{
"url": "https://shop.com/us/widget?referral=you",
"value": 1,
"locale": "us",
"name": "eBay"
}
]
}
locale
- Not implemented but planned. Would prioritize local vendors.vendors
- Select vendor groups. Currently implemented: "ALL"
, which lists all vendors for the link./recommends/group?tag=cameras
Returns all links for a given tag
param.
/recommends/bulk?links=widget,toy,fancy-garmet
Returns all links (including all vendors) from array inferred from links
param (uses array.split(",")
). Limit of 10.
This an example using React framework, however, the idea would be the same in any kind of project (both on server and on the browser):
links
service with the key (must be a string) as a URL path and any parameters sent as a query.export const MyPage = () => {
// manage state of the app (React-specific)
const [myLink, setMyLink] = useState("#default-link");
// send fetch request on page load and update state
useEffect(() => {
try {
const linkResponse = await fetch("/recommends/widget?locale=us");
const linkResponseJson = await linkResponse.json();
setMyLink(linkResponseJson.vendor.url);
} catch(error) {
console.log(error);
}
},[]);
// return page HTML
return <div>This is my example text, oh, and look: an affiliate <a href={myLink}>link</link>!</div>
}
See example for authenticated implementation with an option to edit and archive links
FAQs
A Node.js API for managing affiliate links.
The npm package @roast-cms/links receives a total of 1 weekly downloads. As such, @roast-cms/links popularity was classified as not popular.
We found that @roast-cms/links demonstrated a not healthy version release cadence and project activity because the last version was released 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.