
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
payload-react
Advanced tools
A simple React wrapper around Payload.js. See https://docs.payload.com for more information.
A React library for integrating Payload.js Secure Input.
npm install payload-react
Once you've installed the Payload.js React library to your environment,
import the payload-react components to get started.
import {
PaymentForm,
PaymentMethodForm,
PayloadInput,
CardNumber,
Expiry,
CardCode,
RoutingNumber,
AccountNumber,
ProcessingAccountForm,
Checkout,
openProcessingAccountForm,
openCheckout
} from 'payload-react';
To authenticate with the Payload, you'll need a live or test client token for Payload.js. Client tokens can be generated using the secret key accessible from within the Payload dashboard. For more information on generating a client token, see Authentication.
Below is an example of a react checkout form utilizing Payload.js Secure Inputs and styled with Bootstrap 4.
import React from 'react';
import {
PaymentForm,
PayloadInput,
CardNumber,
Expiry,
CardCode
} from 'payload-react';
function CheckoutForm() {
return <PaymentForm
clientToken='client_key_2zsp9Pske5l2Bgcy3bySES'
className="container"
styles={{invalid: 'is-invalid'}}
onProcessed={(evt)=>{
console.log('processed', evt.transaction_id)
}}
onError={(evt)=>{
alert(evt.message)
}}
>
<PayloadInput attr="amount" type="hidden" value="10.00"/>
<div className="row pt-2">
<div className="form-group col-7 px-1">
<label>Card</label>
<CardNumber className="form-control" onInvalid={(evt)=>{
alert(evt.message)
}}/>
</div>
<div className="form-group col-3 px-1">
<label>Expiration</label>
<Expiry className="form-control" onInvalid={(evt)=>{
alert(evt.message)
}}/>
</div>
<div className="form-group col-2 px-1">
<label>CVC</label>
<CardCode className="form-control"/>
</div>
</div>
<div className="row pt-2">
<button className="btn btn-primary" type="submit">Pay Now</button>
</div>
</PaymentForm>
}
Below is an example of how to open the Payload.js ProcessingAccountForm modal from react.
import {
openProcessingAccountForm
} from 'payload-react';
function OnboardButton() {
return <button
className="btn btn-primary"
onClick={(e) =>
openProcessingAccountForm({
clientToken: 'client_key_2zsp9Pske5l2Bgcy3bySES',
onSuccess(evt) {
console.log(evt.account.id)
}
})
}>
Open Processing Account Form Modal
</button>
}
To get further information on the Payload.js Secure Input library and capabilities, visit the unabridged Payload Documentation.
FAQs
A simple React wrapper around Payload.js. See https://docs.payload.com for more information.
The npm package payload-react receives a total of 341 weekly downloads. As such, payload-react popularity was classified as not popular.
We found that payload-react demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.