Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
A monetization meta tag manager.
import { monetize } from 'monetizer'
Extracted from the Bemuse monorepo into a standalone repository.
// Starts monetizing
const stopMonetizing = monetize('$dt.in.th')
// Stops monetizing
stopMonetizing()
function App() {
useEffect(() => monetize('$dt.in.th'), [])
return <Layout><Main /></Layout>
}
If multiple monetization calls are active, it uses probabilistic revenue sharing to divide the revenue.
// 50% chance
monetize('$dt.in.th')
// 50% chance
monetize('$twitter.xrptipbot.com/bemusegame')
You can specify a weight (default weight is 1).
// 33% chance
monetize({ content: '$dt.in.th', weight: 1 })
// 67% chance
monetize({ content: '$twitter.xrptipbot.com/bemusegame', weight: 2 })
You can also specify priority. Higher priority wins.
function App() {
// Default priority is 0
useEffect(() => monetize('$dt.in.th'), [])
return <Layout><Main /></Layout>
}
function Article(props) {
const paymentPointer = props.author.paymentPointer
// Send micropayment to article’s author while viewing author’s article
useEffect(() => monetize({ content: paymentPointer, priority: 1 }), [])
}
Priority ties are probabilistic-revenue-shared.
function Article(props) {
const paymentPointer = props.author.paymentPointer
// 50-50 revenue sharing between article author and site developer
useEffect(() => monetize({ content: '$dt.in.th', priority: 1 }), [])
useEffect(() => monetize({ content: paymentPointer, priority: 1 }), [])
}
monetize(options: MonetizationOptions | string): function
Registers a candidate for monetization.
options
can be a string that specifies the payment pointer, or an object with these properties:
content: string
Payment pointerweight?: number
Weight for probabilistic revenue sharing (default=1)priority?: number
Priority (default=0)Returns a function
that, when called, removes the candidate from the registry.
When there are multiple monetization candidates in the registry, the library will choose a winner using these criteria:
This project was bootstrapped with TSDX.
Below is a list of commands you will probably find useful.
yarn start
Runs the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab.
Your library will be rebuilt if you make edits.
yarn build
Bundles the package to the dist
folder.
The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).
yarn test
Runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.
FAQs
Web Monetization API for JavaScript
The npm package monetizer receives a total of 6 weekly downloads. As such, monetizer popularity was classified as not popular.
We found that monetizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.