1.0.0 • Published 7 months ago

safedonate v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

SafeDonate API (unofficial)

typescript

An (unofficial) API for SafeDonate, with full types support

Important notice

This API is unofficial, meaning I am not responisble for any damage caused by using this API. This API may be blocked at any time by SafeDonate's team. This API is never stable as SafeDonate can change at any time their website structure that will break this API.

Install

npm install safedonate
# or
yarn add safedonate

Usage

import { fetchDonations } from "safedonate";

fetchDonations().then((donations) => {
  console.log(donations[0]);
});
//=> JSON object containing donation info

(also compitable with commonjs)

API

fetchDonations()

Example

const { fetchDonations } = require("safedonate");

fetchDonations().then((donations) => {
  console.log(donations[0]);
});

Will return something like this:

{
  "URL (public)": "",
  "Title (public)": "",
  "Description (public)": "",
  "Verification Result (public)": "",
  "Original Message (public)": "",
  "Is International? (public)": "",
  "title_english": "",
  "title_spanish": "",
  "title_french": "",
  "title_german": ""
}

Which can be easily accessed by doing (thanks to the types available in the package):

const { fetchDonations } = require("../build/index");

fetchDonations().then((donations) => {
  console.log(donations[0]["URL (public)"]);
});
1.0.0

7 months ago