
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
gatsby-plugin-affirm-js
Advanced tools
A plugin for integrating Affirm JS payment options with Gatsby.
npm install gatsby-plugin-affirm-js
# or
yarn add gatsby-plugin-affirm-js
In the root of your Gatsby project, create 2 environment variables files (.env.development
and .env.production
) if you don't have them already, then ddd this key and value.
AFFIRM_API_KEY=YOUR_AFFIRM_API_KEY
Add the pulugin and its options to gatsby-config.js
in your project.
// 1. Import your .env files
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
});
module.exports = {
plugins: [
// 2. add the plugin
{
resolve: "gatsby-plugin-affirm-js",
options: {
// 3. pass in the API key in the options
AFFIRM_API_KEY: `${process.env.AFFIRM_API_KEY}`,
},
},
],
};
You can now access the Affirm object in your React code using window.affirm
. For example
window.affirm.checkout({});
FAQs
A plugin to add Affirm JS to Gatsby
We found that gatsby-plugin-affirm-js 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
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.