This API client provides basic functionality for Sure PetCare products.
Available features:
- Get details on a pet, including location
- Set the location of pets
npm install --save-dev sure-pet-care-client
With ES modules
import { SurePetCareClient } from 'sure-pet-care-client';
const client = new SurePetCareClient();
client.authenticate('username', 'password').then(...)
Creates a new instance of the client.
const client = new SurePetCareClient();
Authenticates the user using email and password.
client.authenticate(email: string, password: string): Promise<void>;
Returns a list of all pets for authenticated user.
client.getPets(): Promise<Pet[]>;
Returns a pet by a given name (case insensitive). Throws an error if the pet is not found.
client.getPetByName(name: string): Promise<Pet>;
Returns a pet by ID. Throws an error if the pet is not found.
client.getPetByName(id: number): Promise<Pet>;
Sets the location of a pet, with an optional timestamp for when the change happened.
client.setPetLocation(petID: number, location: PetLocation, since?: Date): Promise<void>;
Example:
await client.setPetLocation(123, PetLocation.Inside, new Date());
All types are available in the ./src/types.ts