
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
next-tsr
sets up an optional typesafe routing system for NextJS. It maintains a global list of both pages and API routes and provides components and functions to easily navigate to pages, or make API requests.
Initialize your NextJS application:
npx next-tsr init
This will generate an @/routes
directory that you can use to navigate to pages and make API requests. It also generates a NEXT-TSR-README.md
file in the root of your project that contains information about how to use the system.
You can update the files when the route paths change using the build
command. This will update the @/routes
directory to reflect the new paths. For example, if you add a new page, you can run the following command to update the routes:
npx next-tsr build
Instead of doing this:
import Link from "next/link";
<Link href={`/product/${product.id}`}>Product</Link>;
You can do this:
import { ProductDetail } from "@/routes";
<ProductDetail.Link productId={product.id}>Product</ProductDetail.Link>;
API routes are fully typesafe. Instead of doing this:
// Data is any
const data = await fetch(`/api/product/${productId}`).then((res) => res.json());
You can do this:
import { getProduct } from "@/routes";
// Data is strongly typed as the response of the getProduct function
const data = await getProduct({ productId });
And both the request and the response are strongly typed.
Because the system knows all of the API routes, their verbs, and their parameters, it can generate an OpenAPI schema for your API. This can be used to generate documentation, or to generate client libraries for your API.
This system is opt-in. You can use it for some routes, and not for others. You can use it for some parts of your application, and not for others. It's designed to be flexible and to work with your existing code, and to be incrementally adoptable.
FAQs
NextJS Typesafe Router
The npm package next-tsr receives a total of 0 weekly downloads. As such, next-tsr popularity was classified as not popular.
We found that next-tsr 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.