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 + IorF12and go to theNetworktab - 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-tokencookie. - Chrome: In the tabs (Elements, Network, ...), go to
Application, in theStoragepart, expand the cookies section, click onhttps://earnapp.com, then copy the value of theoauth-refresh-tokencookie.
- go to the EarnApp dashboard
- open the dev tools by pressing
Ctrl + Shift + IorF12and go to theNetworktab - log into your account
- in the last requests, search for the one beginning with
token - in the
Headerstab, in theResponse Headerspart, look for the 4set-cookieheaders - copy the value of
auth-method(should begooglesince 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
});