Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Latest commit

 

History

History
47 lines (31 loc) · 1.48 KB

README.md

File metadata and controls

47 lines (31 loc) · 1.48 KB

Givey JavaScript SDK

This is a preview release so please use at your own risk and report any issues you may experience. Contact Givey Support if you have any questions.

Code Climate Build Status Bower version

Usage

Create a new instance

Before using the Givey API you will want to create a new instance to work with. You will require an access token which can be obtained from the Givey Developer Portal.

var Givey = new GiveyApp({
  token: "XXXX"
});

Loading an Entity

There are many entities on Givey which can be interacted with. The current entity list contains Charity, User, Business and Donation.

Givey.find('business', 'giveybiz').then(function (business) {
  business.get('name'); // Givey Ltd
});

Relationships

Entities can contain relationships to other entities which are resolved asynchronously. Relationships are not resolved until the first time they are called via entity.get().

Givey.find('business', 'giveybiz').then(function (business) {
  business.get('employees').then(function (employees) {
    $.each(employees, function (_, user) {
      user.get('giveyTag');
    });
  });
});