Sample NodeJS/Express backend to provide a REST API to query the fundraising progress of a GoFundMe Pro campaign.
This project is meant to be a simple example of how to connect to the GoFundMe Pro API, consume information about campaigns and expose it through a REST API. It is not meant to be a full-fledged application, nor to be used in production as-is.
- Node.js 14+ (it's recommended to use nvm, and if so, you can run
nvm useto switch to the correct Node.JS version)
- Clone the repository
- Install dependencies:
npm install - Copy the
.env.templatefile to.envand update environment variables as needed. In particular, ensure thatGO_FUND_ME_PRO_CLIENT_IDandGO_FUND_ME_PRO_CLIENT_SECRETare set. You can obtain these by creating a new application in the GoFundMe Pro Developer Portal. - Start the development server:
npm run dev
This project is meant as an example of how to consume the GoFundMe Pro APIs.
It provides a simple REST API with a single endpoint /campaigns/:id that returns the fundraising progress of a GoFundMe Pro campaign.
This project can be consumed directly, via an API platform like Postman or through our sample frontend project.
This project uses Express to create a simple REST API with two routes defined in the src/server.ts file:
GET /health-check: A simple health check endpoint that returns a 200 status code if the server is running.GET /campaigns/:campaignId/progress: An endpoint that returns the fundraising progress of a GoFundMe Pro campaign.
Each route group is handled by a separate router file inside the src/api folder.
Within the src/common/utils/auth.ts file, you will find the logic to authenticate with the GoFundMe Pro API using the client id and secret.