Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is the source code please? #669

Closed
tylerlong opened this issue Sep 8, 2020 · 13 comments
Closed

Where is the source code please? #669

tylerlong opened this issue Sep 8, 2020 · 13 comments

Comments

@tylerlong
Copy link

This one is kind of too short: https://github.com/google/google-api-javascript-client/blob/master/javascripts/main.js

@Maxim-Mazurok
Copy link

With the way the client is written, it's impossible to make the client public without a full rewrite.

#432 (comment)

@Maxim-Mazurok
Copy link

That said, you and @jbasinger are welcome to join me in the research of GAPI source code, you can find my code and findings here: https://github.com/Maxim-Mazurok/gapi

@tylerlong
Copy link
Author

@Maxim-Mazurok Thanks. I turned to use https://github.com/googleapis/google-api-nodejs-client instead

@Maxim-Mazurok
Copy link

Cool, so you needed library for the backend, not for the front-end.

@tylerlong
Copy link
Author

tylerlong commented Sep 28, 2020

Cool, so you needed library for the backend, not for the front-end.

I need it for frontend. And I created a proxy on server side.

And it is not just frontend vs backend. google-api-nodejs-client is way more powerful than this project. I mean this project is not a browser side clone of the node.js lib. There are lots of things that it cannot do while the node.js one can do. So even my app is a pure frontend one, I cannot use this lib.

@Maxim-Mazurok
Copy link

Interesting... Which API are you using?

As far as I know, NodeJS version of the lib is generated using the same Google API Discovery schema. So, there should not be any difference...

@tylerlong
Copy link
Author

Interesting... Which API are you using?

As far as I know, NodeJS version of the lib is generated using the same Google API Discovery schema. So, there should not be any difference...

I am using the service account with domain-wide authority.

@Maxim-Mazurok
Copy link

Ohh.. so, it's not like other APIs (such as Sheets or Drive), looks like you're interested in gapi.auth2, which is not covered by Google API Discovery.
The closest to what you want will be here, eventually: https://github.com/Maxim-Mazurok/gapi/blob/master/client/unminified.js
But I barely started my research on this file.

@tylerlong
Copy link
Author

Ohh.. so, it's not like other APIs (such as Sheets or Drive), looks like you're interested in gapi.auth2, which is not covered by Google API Discovery.
The closest to what you want will be here, eventually: https://github.com/Maxim-Mazurok/gapi/blob/master/client/unminified.js
But I barely started my research on this file.

I am not an expert either. I just struggled to get what I want done.

I do need to invoke APIs like Sheets, Drive, Calendar...etc. But I need to invoke the API as the admin on behalf of other users. Let's say there are 1000 users in the company, I only need to authorize as the admin to update everybody's calendar.

@Maxim-Mazurok
Copy link

In this case, you definitely have to use NodeJS GAPI, not a client-side JS.

It says

server-to-server interactions

on the page you shared.

As far as I understand, this is a very sensitive action, so Google doesn't allow this on the client. Also, all of their examples involve back-end languages, such as Java.

I may be wrong on this one, but I think that you can't use a service account on the front-end.

@tylerlong
Copy link
Author

@Maxim-Mazurok what you said are all correct.

My app's GUI is on frontend so I need to initiate the call from frontend. I created a proxy on server: https://github.com/tylerlong/express-proxy/blob/master/src/index.ts#L69-L79 so that I can invoke it from frontend. May not be the best practice but it works for me.

@Maxim-Mazurok
Copy link

Got it... As long as you keep your website private - it should be fine :) Thanks for sharing!

@dvanderb
Copy link
Collaborator

The source code for GAPI is currently not published and is periodically updated by Google. It is not suggested or supported to use downloaded versions of the code. I am closing this for now, but if you still need help with this question, please reopen.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants