-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Accessing Google Calendar API with a token in React #1385
Comments
@artooras All api has parameter |
Hi @ajaaym. I was referring to the Google OAuth token. In my
and then I pass it as a |
can you try below? const {google} = require('googleapis');
const oAuth2Client = new google.auth.OAuth2();
oAuth2Client.setCredentials({access_token:"Token received from firebase"});
google.options({auth:oAuth2Client}); |
Strangely enough, as soon as I add
I will note that I am importing this library in my client-sidd React code. Can this be the issue? Is this library perhaps intended only for server-side Node.js implementations? |
Looks like it needs fs module link here which is not available on client side. |
See googleapis/google-cloud-node#531 for more details |
Greetings, we're closing this. Looks like the issue got resolved. Please let us know if the issue needs to be reopened. |
I have been searching the web for days trying to find an example of how to properly access Google Calendar API in my React application. Here are a few notes on my setup:
scope: 'https://www.googleapis.com/auth/calendar'
) and save the resulting access token in my App.js component.gapi
fromhttps://apis.google.com/js/api.js
, but I don't want to do this due to various CORS warnings I get as a result.googleapis
what I need?So, in my
Calendar.js
I know how to get the events from Google Calendar API (because I have previously done it with script injection as mentioned above):but how do I use
googleapis
to get to the point where I am authenticated with the token that I have (this.props.token
) and have aCALENDAR
object that I can make a request to?I would really appreciate some guidance on this.
The text was updated successfully, but these errors were encountered: