Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
forage-js-sdk
Advanced tools
Forage Javascript SDK to create iframe input fields
Ensure that Node.js and npm are installed on your computer before running:
npm install forage-js-sdk
ForageFrame
is a generic class representing a single iFrame inside your application's DOM. These iFrames will be used to securely collect text input from your customer. Each iFrame is composed of a single HTML input field and a "Powered by Forage" logo. ForageFrame
objects should be instantiated through the static create
method. The arguments to ForageFrame.create
are,
formId
- The id of the tag where the iFrame for the input field will be inserted in the pageframeOption
- The type of iFrame you wish to instantiate, one of ebtCardCapture | balanceCheck | paymentCapture
. These options correspond to the 3 functions described above.environment
- either sandbox
or prod
bearerToken
- The Oauth token generated by your backend which authenticates your app against the Forage Payments APIoptions
- An object with additional optional parameters
version
- The version string for the SDK of format YYYY-MM-DDcss
- Custom styling for the input fieldcallback: (state) => void
- A function which allows you to respond to changes in state of the iFrame. This function is called every time the content of the iFrame input field changes.successColor
- hex color code for the input field border when the input is validerrorColor
- hex color code for the input field border when the input is not validplaceholder
- the placeholder text when there is no content inside the input fieldExample EBT Card Capture
import { ForageFrame } from 'forage-js-sdk'
const cardInputFrame = ForageFrame.create(
'card-capture-field',
'ebtCardCapture',
'sandbox',
)
// Card Input field is injected into the element with id card-capture-field and the customer inputs their card number.
cardInputFrame.submitEbtCardCapture(
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhIjo0LCJleHAiOjE2Njg4MDcyNDF9.oQ2LMnhfTKEp-4dIuGuh3lec87_6rhKXfSJGMYMYNPA',
'1234567',
async (status: number, response: any) => {
console.log(response)
},
(status: number, errors: any) => {
console.log(errors)
}
)
Example Balance Request
import { ForageFrame, Balance } from 'forage-js-sdk'
const balanceCheckFrame = ForageFrame.create(
'balance-check-field',
'pinBalanceCheckCapture',
'sandbox',
)
// Balance Check PIN field is injected into the element with id balance-check-field and the customer inputs their EBT PIN.
balanceCheckFrame.submitPinBalanceCheckCapture(
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhIjo0LCJleHAiOjE2Njg4MDcyNDF9.oQ2LMnhfTKEp-4dIuGuh3lec87_6rhKXfSJGMYMYNPA',
'1234567',
'6c0b6061d3',
'tok_sandbox_9yAmy2SJ8QREz2qxSdcfxB',
(status: number, response: Balance) => {
console.log(response)
},
(status: number, errors: any) => {
console.log(errors)
}
)
Example Capture Request
import { ForageFrame } from 'forage-js-sdk'
const captureFrame = ForageFrame.create(
'capture-field',
'pinPaymentCapture',
'sandbox',
)
// Balance Check PIN field is injected into the element with id balance-check-field and the customer inputs their EBT PIN.
captureFrame.submitPinPaymentCapture(
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhIjo0LCJleHAiOjE2Njg4MDcyNDF9.oQ2LMnhfTKEp-4dIuGuh3lec87_6rhKXfSJGMYMYNPA',
'1234567',
'6c0b6061d3',
'tok_sandbox_9yAmy2SJ8QREz2qxSdcfxB',
(status: number, response: any) => {
console.log(response)
},
(status: number, errors: any) => {
console.log(errors)
}
)
FAQs
Forage JS is a front-end JavaScript library for processing EBT payments. You can use the library to add all of the essential EBT checkout operations to your website or app:
The npm package forage-js-sdk receives a total of 774 weekly downloads. As such, forage-js-sdk popularity was classified as not popular.
We found that forage-js-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.