Skip to content

givey/givey-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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');
    });
  });
});