Skip to content

Instantly share code, notes, and snippets.

@Arjun-sna
Last active March 10, 2019 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arjun-sna/5ef325627eeb4bd510a75aff4d598c33 to your computer and use it in GitHub Desktop.
Save Arjun-sna/5ef325627eeb4bd510a75aff4d598c33 to your computer and use it in GitHub Desktop.
import Config from 'react-native-config';
import axios from 'axios';
const response = await axios(GITHUB_OAUTH_ENDPOINT, {
method: METHOD.POST,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
data: JSON.stringify({
client_id: Config.CLIENT_ID, // Access CLIENT_ID env varaible using `Config`
client_secret: Config.CLIENT_SECRET, // Access CLIENT_SECRET env varaible using `Config`
code,
state,
}),
});
@Arjun-sna
Copy link
Author

Js API call

@Arjun-sna
Copy link
Author

Testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment