Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Hackathon Starter | 34,339 | 2 | 6 days ago | 7 | December 09, 2020 | 11 | mit | JavaScript | ||
A boilerplate for Node.js web applications | ||||||||||
Google Api Nodejs Client | 10,836 | 19 | a day ago | 20 | July 10, 2023 | 172 | apache-2.0 | TypeScript | ||
Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included. | ||||||||||
Gam | 3,183 | 17 hours ago | 65 | apache-2.0 | Python | |||||
command line management for Google Workspace | ||||||||||
Gcalcli | 3,064 | 5 | a month ago | 19 | June 01, 2020 | 190 | mit | Python | ||
Google Calendar Command Line Interface | ||||||||||
Wordpress Android | 2,836 | 17 hours ago | 1,022 | gpl-2.0 | Kotlin | |||||
WordPress for Android | ||||||||||
Gcsf | 2,315 | a month ago | 23 | July 24, 2023 | 41 | mit | Rust | |||
a FUSE file system based on Google Drive | ||||||||||
Login With | 2,293 | 2 | 2 years ago | 9 | August 08, 2018 | 35 | mit | JavaScript | ||
Stateless login-with microservice for OAuth | ||||||||||
Youtube Upload | 1,960 | a month ago | 105 | Python | ||||||
Upload videos to Youtube from the command line | ||||||||||
Outlookgooglecalendarsync | 1,603 | a month ago | 182 | mpl-2.0 | C# | |||||
Sync your Outlook and Google calendars | ||||||||||
Macassistant | 1,592 | 7 months ago | 32 | mit | Swift | |||||
Google Assistant for macOS! |
An AngularJS module for using all Google Apis and your Google Cloud Endpoints (Google App Engine) with OAuth. This module uses Google APIs Client Library for JavaScript, available for all GApis.
This module is available as bower
package, install it with this command:
$ bower install --save angular-google-gapi
it's also available as a npm
package, install it with this command:
$ npm install --save angular-google-gapi
or you may download the latest release
<script type="text/javascript" src="/angular-google-gapi/dist/angular-google-gapi.min.js"></script>
var app = angular.module('myModule', ['angular-google-gapi']);
add run()
in root module
app.run(['GApi', 'GAuth',
function(GApi, GAuth) {
var BASE = 'https://myGoogleAppEngine.appspot.com/_ah/api';
GApi.load('myApiName', 'v1', BASE).then(function(resp) {
console.log('api: ' + resp.api + ', version: ' + resp.version + ' loaded');
}, function(resp) {
console.log('an error occured during loading api: ' + resp.api + ', resp.version: ' + version);
});
}
]);
add run()
in root module
app.run(['GAuth', 'GApi', 'GData', '$state', '$rootScope',
function(GAuth, GApi, GData, $state, $rootScope) {
$rootScope.gdata = GData;
var CLIENT = 'yourGoogleAuthAPIKey';
var BASE = 'https://myGoogleAppEngine.appspot.com/_ah/api';
GApi.load('myApiName','v1',BASE);
GApi.load('calendar','v3'); // for google api (https://developers.google.com/apis-explorer/)
GAuth.setClient(CLIENT)
// default scope is only https://www.googleapis.com/auth/userinfo.email
GAuth.setScope('https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/calendar.readonly');
// load the auth api so that it doesn't have to be loaded asynchronously
// when the user clicks the 'login' button.
// That would lead to popup blockers blocking the auth window
GAuth.load();
// or just call checkAuth, which in turn does load the oauth api.
// if you do that, GAuth.load(); is unnecessary
GAuth.checkAuth().then(
function (user) {
console.log(user.name + ' is logged in');
$state.go('webapp.home'); // an example of action if it's possible to
// authenticate user at startup of the application
},
function() {
$state.go('login'); // an example of action if it's impossible to
// authenticate user at startup of the application
}
);
}
]);
GApi.load
Error handlingGApi.load('myApiName', 'v1', BASE)
.catch(function(api, version) {
console.log('an error occured during loading api: ' + api + ', version: ' + version);
});
app.controller('myController', ['$scope', 'GApi',
function myController($scope, GApi) {
GApi.execute('youApi', 'you.api.method.name').then(function(resp) {
$scope.value = resp;
}, function() {
console.log('error :(');
});
}
]);
app.controller('myController', ['$scope', 'GApi',
function myController($scope, GApi) {
GApi.execute('youApi', 'you.api.method.name', {param: value}).then(function(resp) {
$scope.value = resp;
}, function() {
console.log('error :(');
});
}
]);
app.controller('myController', ['$scope', 'GApi',
function myController($scope, GApi) {
GApi.executeAuth('youApi', 'you.api.method.name').then(function(resp) {
$scope.value = resp;
}, function() {
console.log('error :(');
});
}
]);
app.controller('myController', ['$scope', 'GApi',
function myController($scope, GApi) {
GApi.executeAuth('youApi', 'you.api.method.name', {param: value}).then(function(resp) {
$scope.value = resp;
}, function() {
console.log('error :(');
});
}
]);
The login should be triggered by a user action, or you might run into issues with popup blockers. More information about this can be found in the Google APIs Client Library Documentation.
app.controller('myController', ['$scope', 'GAuth', '$state',
function myController($scope, GAuth, $state) {
$scope.doSignup = function() {
GAuth.login().then(function(user) {
console.log(user.name + ' is logged in');
$state.go('webapp.home'); // action after the user have validated that
// your application can access their Google account
}, function() {
console.log('login failed');
});
};
}
]);
Get user info after login is very simple
app.controller('myController', ['$rootScope',
function myController($rootScope) {
console.log($rootScope.gdata.getUser().name);
}
]);
<h1>{{gdata.getUser().name}}</h1>
User object:
email
picture
(url)id
(Google id)name
(Google account name or email if don't exist)link
(link to Google+ page)gulp
is used to minify angular-google-gapi.js
(using Uglify). Execute npm install
(requires Node.js
and npm
) to install the required packages.
Run gulp
to generate a minified version (angular-google-gapi.min.js
). Note that this requires gulp
to be installed globally (via npm install -g gulp
).