1.0.10 • Published 5 years ago

adopt-a-pet v1.0.10

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Adopt-a-Pet

Greenkeeper badge

Adopt-a-Pet API Client for Node

Installation

npm i adopt-a-pet

Setup

  • Get API keys for your shelter
  • Set API key and ShelterId to environment variables: (optional)
  export ADOPT_API_KEY=xxx
  export SHELTER_ID=90641

Usage:

const AdoptPet = require('adopt-a-pet')

// Instantiate the adopt-a-pet API Client
// Parameters are not required if environment variables are set
const adoptPet = new AdoptPet(shelterId, apiKey)

//
// Get all pets for current shelter
//
adoptPet.getPets()
.then((pets) => {
  // returns an array of pet objects
  return pets;
});

//
// Get a random pet from the list of current shelter pets
//
adoptPet.getRandomPet()
.then((pet) => {
  // return the random pet object
  return pet;
})

//
// Get pet details using a petId and boolean to limit details
//
adoptPet.getPetDetails(petId, true)
.then((pet) => {
  // returns detailed pet object
  return pet;
});
1.0.10

5 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago