Skip to content

Instantly share code, notes, and snippets.

Last active December 31, 2020 23:40
What would you like to do?
A TypeScript snippet for making external authenticated web API calls in Electron
import electron from 'electron';
function performExternalRequest() {
const cookieJar = electron.remote.session.defaultSession.cookies;
const cookie = {
url: '',
name: 'your-cookie-name',
value: 'your-cookie-value'
.then(() => {
fetch('https://your-api.domain/endpoint', {
credentials: 'include'
.then((response) => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment