Skip to content

mjschutz/react-googleaccount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-googleaccount

This is a Android React Native module that make use of google-auth-library-java to get a JWT token from Service Account to access Google Cloud APIs.

Usage

import GoogleAccount from 'react-googleaccount'

GoogleAccount.fromString(
	JSON.stringify(require('./project-id.json'))),
	['https://www.googleapis.com/auth/drive']
).then((token) => {
	alert(token);
}).catch(console.err);

// Refresh/Get the current token after call of GoogleAccount.fromString
GoogleAccount.getAccessToken().then((token) => {
	alert(token);
}).catch(console.err);

Releases

No releases published

Packages

No packages published