Skip to content

Instantly share code, notes, and snippets.

View ThisNils's full-sized avatar
🙂

Nils S. ThisNils

🙂
View GitHub Profile
@ThisNils
ThisNils / deviceauth.js
Last active October 9, 2021 22:07
Example on how to create and use device auths.
const request = require('request-promise');
const fs = require('fs').promises;
const BASE_URL = 'https://www.epicgames.com/id/api';
const BASE_PROD = 'https://account-public-service-prod03.ol.epicgames.com/account/api/oauth';
const DEVICE_AUTH = 'https://account-public-service-prod.ol.epicgames.com/account/api/public/account';
const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36';
const IOS_TOKEN = 'MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I0MWE=';
const LAUNCHER_TOKEN = 'MzRhMDJjZjhmNDQxNGUyOWIxNTkyMTg3NmRhMzZmOWE6ZGFhZmJjY2M3Mzc3NDUwMzlkZmZlNTNkOTRmYzc2Y2Y=';
const { Launcher } = require('epicgames-client');
const request = require('request-promise');
const deviceAuthCredentials = {
accountId: '',
deviceId: '',
secret: '',
};
/*
@ThisNils
ThisNils / EventBase.ts
Created October 17, 2022 08:12
Adds types to EventEmitter methods
import { EventEmitter } from 'events';
type EventTypes = Record<string | symbol, (...args: []) => void>;
/**
* Adds types to the following methods of {@link EventEmitter}
* * {@link EventEmitter.on}
* * {@link EventEmitter.off}
* * {@link EventEmitter.once}
* * {@link EventEmitter.emit}