1.0.6 • Published 5 years ago

@petfinder/petfinder-js v1.0.6

Weekly downloads
272
License
BSD-3-Clause
Repository
github
Last release
5 years ago

Petfinder JS SDK

CircleCI npm version Coverage Status

A JS wrapper for the Petfinder API, written in JavaScript/TypeScript.

Features

  • TypeScript definition
  • Promises (via Axios)
  • Well tested

Install

Using npm:

npm install --save @petfinder/petfinder-js

In browser:

<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://unpkg.com/@petfinder/petfinder-js/dist/petfinder.min.js"></script>

Usage (Browser)

var pf = new petfinder.Client({apiKey: "my-api-key", secret: "my-api-secret"});

pf.animal.search()
    .then(function (response) {
        // Do something with `response.data.animals`
    })
    .catch(function (error) {
        // Handle the error
    });

Usage (Node/CommonJS)

var petfinder = require("@petfinder/petfinder-js");
var client = new petfinder.Client({apiKey: "my-api-key", secret: "my-api-secret"});

client.animal.search()
    .then(function (response) {
        // Do something with `response.data.animals`
    })
    .catch(function (error) {
        // Handle the error
    });

Usage (TypeScript/ES6 Module)

import { Client } from "@petfinder/petfinder-js";

const client = new Client({apiKey: "my-api-key", secret: "my-api-secret"});

client.animal.search()
    .then(function (response) {
        // Do something with `response.data.animals`
    })
    .catch(function (error) {
        // Handle the error
    });

Documentation

See docs directory for more detailed documentation.

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago