Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

forage-js-sdk

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forage-js-sdk

Forage Javascript SDK to create iframe input fields

  • 0.1.3
  • npm
  • Socket score

Version published
Weekly downloads
903
increased by98.9%
Maintainers
1
Weekly downloads
 
Created
Source

forage-js-sdk

Forage Javascript SDK to create iframe input fields

Setup dev environment

  1. Clone both this repo and the Forage Input Iframe repo.
  2. Run yarn install then yarn start in both repos.
  3. Go to localhost:4000 in your local browser.
  4. At this point you should be able to create a ForageCollect instance in the browser's developer console. i.e. var form = ForageCollect.create("cert", "fns_number", "bearer_token", "version", (state) => console.log(state))

Make API calls locally

  1. In configuration.ts, replace the url inside the submit function to the call you would like to make with url: "http://localhost:8000/api{path}"
  2. In start.js, change the default port from const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 4000; to const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;. The request must come form port 3000 to pass CORS with the local backend.
  3. In the Forage Input Iframe repository, change the package.json start script to "start": "PORT=3001 react-scripts start". Now the SDK is running on port 3000 and the Input Frame is running on port 3001.
  4. Finally, in the constants.ts file, alter the IFRAME_URL constant to http://localhost:3001. Now, the SDK is looking at the correct port for the Forage Input Frame.
  5. Start all three local servers: this server, the Forage Input iframe server, and the payments-api server.
  6. Then, use the browser's developer console and create a form: var form = ForageCollect.create("cert", "1234567", "wowsecurityisfun", "version", (state) => console.log(state))

FAQs

Package last updated on 02 Dec 2022

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