Before you start building with Forage JS, make sure that you’ve done the following:
Contact us for sandbox credentials
If you aren’t already in touch with the Forage team, then send a message through our contact form. Our onboarding team can help set up your Forage account name, temporary password, and an FNS number if you don’t already have one.
You have seven days to create a new password.
The first time that you login, the Forage dashboard prompts you to create a new one.
When you’re ready for production, the team will set you up with a separate set of production credentials 🚀
Register a client application with Forage
- Log in to the Forage dashboard.
- Navigate to API Settings.
- Click Create Application and name your app.
Retrieve your client ID and secret
On your application page, expand the accordion to view your client ID and client secret.
Create an authentication and a session token
Once you have your client ID and client secret, generate an authentication token and then a session token. You need a session token and your FNS number, to initialize Forage JS.
Authentication tokens should only be used on the client side during testing and development. Do not use them in production on the client. Authentication tokens can be used safely for any API requests originating from your backend server.
For more information on authenticating with Forage, check out the authentication guide.
Include Forage JS
Include the below Forage JS
<script> tag on every page that handles an EBT checkout operation:
If you’re using a frontend library like React or a framework like Vue, then you most likely only need to include the tag once in your
Or, install the npm package
From your project directory, run:
npm install forage-js-sdk