New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-plugin-affirm-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-affirm-js

A plugin to add Affirm JS to Gatsby

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gatsby-plugin-affirm-js

A plugin for integrating Affirm JS payment options with Gatsby.

Installation

npm install gatsby-plugin-affirm-js

# or

yarn add gatsby-plugin-affirm-js

Configuration and usage

.env.*

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

gatsby-config.js

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({});

Keywords

FAQs

Package last updated on 11 Jan 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc