The library uses 2 cookies to connect to EarnApp.
These cookies are subject to expiration, they may not work indefinitely.
To get these cookies you need to:
This method applies to all cookies you might need (auth, xsrf, ...)
- go to the EarnApp dashboard
- open the dev tools by pressing
Ctrl + Shift + I
orF12
and go to theNetwork
tab - log into your account
- Firefox: In the tabs (Inspector, Network, ...), go to
Storage
, expand the cookies section, click onhttps://earnapp.com
, then copy the value of theoauth-refresh-token
cookie. - Chrome: In the tabs (Elements, Network, ...), go to
Application
, in theStorage
part, expand the cookies section, click onhttps://earnapp.com
, then copy the value of theoauth-refresh-token
cookie.
- go to the EarnApp dashboard
- open the dev tools by pressing
Ctrl + Shift + I
orF12
and go to theNetwork
tab - log into your account
- in the last requests, search for the one beginning with
token
- in the
Headers
tab, in theResponse Headers
part, look for the 4set-cookie
headers - copy the value of
auth-method
(should begoogle
since it is the only available right now) andoauth-refresh-token
. Values end by a semicolon (;
). - example:
header:set-cookie: auth-method=google; Path=/; HttpOnly; Secure
value:google
- write the cookies in the client.dashboard.login function:
client.dashboard.login({
authMethod: "google",
oauthRefreshToken: "1%2F%2F0dx...mfz75",
//don't include 'set-cookie: oauth-refresh-token='
xsrfToken: "uE9Tm4sXtk4wHEz4tZFJyANB",
//needed for endpoints like linking a device / or making a payout
});