Kind: global class
- Client
- new Client()
- .CLIENT_API_URL :
string
- .dashboard :
Dashboard
- .piggybox :
PiggyBox
- .registerDevice(uuid, version, arch, appid) ⇒
Promise.<Object>
- .deviceStats(uuid, version, arch, appid) ⇒
Promise.<Object>
The EarnApp client
Example
const client = new Client();
The client API URL
Kind: instance property of Client
client.dashboard : Dashboard
The EarnApp dashboard client
Kind: instance property of Client
client.piggybox : PiggyBox
The PiggyBox dashboard client
Kind: instance property of Client
Register a new device on EarnApp database. Use client.linkDevice to link it to your account.
Kind: instance method of Client
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
version | string |
app version |
arch | string |
device arch: arm, arm64, x64, android |
appid | string |
app id: node_earnapp.com, win_earnapp.com, com.eapp, mac_com.earnapp |
Example
client.registerDevice("sdk-win-7744606f9f7b42d5b99d11e80f70886c", "1.295.874", "x64", "win_earnapp.com");
Example
client.registerDevice("sdk-node-6fd29568de6f481887ccf0ddea29dcca", "1.293.301", "x64", "node_earnapp.com");
Get a device stats on EarnApp database.
Kind: instance method of Client
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
version | string |
app version |
arch | string |
device arch: arm, arm64, x64, android |
appid | string |
app id: node_earnapp.com, win_earnapp.com, com.eapp, mac_com.earnapp |
Example
client.deviceStats("sdk-win-7744606f9f7b42d5b99d11e80f70886c", "1.295.874", "x64", "win_earnapp.com");
Example
client.deviceStats("sdk-node-6fd29568de6f481887ccf0ddea29dcca", "1.293.301", "x64", "node_earnapp.com");
Kind: global class
- Dashboard
- new Dashboard()
- .API_URL :
string
- .login(authCookies) ⇒
Object
- .getCSRF(authCookies) ⇒
Promise.<Object>
- .downloads() ⇒
Promise.<Object>
- .paymentMethods() ⇒
Promise.<Object>
- .userData() ⇒
Promise.<Object>
- .devices() ⇒
Promise.<Object>
- .transactions() ⇒
Promise.<Object>
- .stats() ⇒
Promise.<Object>
- .referrals() ⇒
Promise.<Object>
- .counters() ⇒
Promise.<Object>
- .promotions() ⇒
Promise.<Object>
- .notifications() ⇒
Promise.<Object>
- .linkDevice(uuid) ⇒
Promise.<Object>
- .setPaymentDetails(email, method) ⇒
Promise.<Object>
- .redeem(email, method) ⇒
Promise.<Object>
- .removeAutoRedeem() ⇒
Promise.<Object>
- .logout() ⇒
Promise.<Object>
- .check(ip) ⇒
Promise.<Object>
- .rename(uuid, name) ⇒
Promise.<Object>
- .remove(uuid) ⇒
Promise.<Object>
- .hide(uuid) ⇒
Promise.<Object>
- .show(uuid) ⇒
Promise.<Object>
- .usage(step) ⇒
Promise.<Object>
- .devicesStatus(list) ⇒
Promise.<Object>
- .brightvpnReferrals() ⇒
Promise.<Object>
- .speedtests() ⇒
Promise.<Object>
- .deleteAccount(reason) ⇒
Promise.<Object>
- .disableAccount() ⇒
Promise.<Object>
- .restoreAccount() ⇒
Promise.<Object>
The EarnApp dashboard client
Example
const dashboard = new Dashboard();
The base API URL
Kind: instance property of Dashboard
Log into the dashboard.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
authCookies | Object |
|
authCookies.authMethod | string |
authentication method |
authCookies.oauthRefreshToken | string |
OAuth refresh token |
authCookies.xsrfToken | string |
CSRF token |
Example
client.dashboard.login({ authMethod: "google", oauthRefreshToken: "1%2F%2F0dx...mfz75", xsrfToken: "uE9Tm4sXtk4wHEz4tZFJyANB" });
Get the CSRF token from the dashboard. Automatically sets the CSRF token for future requests.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
authCookies | Object |
|
authCookies.authMethod | string |
authentication method |
authCookies.oauthRefreshToken | string |
OAuth refresh token |
Example
client.dashboard.getCSRF({ authMethod: "google", oauthRefreshToken: "1%2F%2F0dx...mfz75" });
Get the app versions.
Kind: instance method of Dashboard
Example
client.dashboard.downloads();
Get the available payment methods.
Kind: instance method of Dashboard
Example
client.dashboard.paymentMethods();
Get your user data.
Kind: instance method of Dashboard
Example
client.dashboard.userData();
Get user devices.
Kind: instance method of Dashboard
Example
client.dashboard.devices();
Get user transactions.
Kind: instance method of Dashboard
Example
client.dashboard.transactions();
Get user stats.
Kind: instance method of Dashboard
Example
client.dashboard.stats();
Get user referrals.
Kind: instance method of Dashboard
Example
client.dashboard.referrals();
Get counters before balances update and auto redeem.
Kind: instance method of Dashboard
Example
client.dashboard.stats();
Get user promotions.
Kind: instance method of Dashboard
Example
client.dashboard.offers();
Get EarnApp current notifications.
Kind: instance method of Dashboard
Example
client.dashboard.notifications();
Link a new device to your account.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
Example
client.dashboard.linkDevice("sdk-win-7744606f9f7b42d5b99d11e80f70886c");
Set your payment details.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
string |
paypal / amazon email | |
method | string |
methods: to see methods do client.dashboard.paymentMethods |
Example
client.dashboard.setPaymentDetails("[email protected]", "paypal.com");
Example
client.dashboard.setPaymentDetails("[email protected]", "amazon.com (US/Global)");
Redeem your balance.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
string |
paypal / amazon email | |
method | string |
methods: to see methods do client.dashboard.paymentMethods |
Example
client.dashboard.redeem("[email protected]", "paypal.com");
Example
client.dashboard.redeem("[email protected]", "amazon.com (US/Global)");
Remove auto redeem.
Kind: instance method of Dashboard
Example
client.dashboard.removeAutoRedeem();
Log out of your account.
Kind: instance method of Dashboard
Example
client.dashboard.logout();
Check an ip for EarnApp.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
ip | string |
ip to check |
Example
client.dashboard.check("1.1.1.1");
Rename a device.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
name | string |
new device name |
Example
client.dashboard.rename("sdk-win-7744606f9f7b42d5b99d11e80f70886c", "new name");
Remove a device.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
Example
client.dashboard.remove("sdk-win-7744606f9f7b42d5b99d11e80f70886c");
Hide a device.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
Example
client.dashboard.hide("sdk-win-7744606f9f7b42d5b99d11e80f70886c");
Show a device.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
Example
client.dashboard.show("sdk-win-7744606f9f7b42d5b99d11e80f70886c");
Get user devices usage.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
step | string |
usage step: daily, weekly, monthly |
Example
client.dashboard.usage("daily");
Get user devices status.
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
list | Array |
devices list |
Example
client.dashboard.devicesStatus([ "sdk-win-7744606f9f7b42d5b99d11e80f70886c" ]);
Get user BrightVPN referrals.
Kind: instance method of Dashboard
Example
client.dashboard.brightvpnReferrals();
Get speedtests.
Kind: instance method of Dashboard
Example
client.dashboard.speedtest();
Delete your account. CANNOT BE UNDONE
Kind: instance method of Dashboard
Param | Type | Description |
---|---|---|
reason | string |
deletion reason |
Example
client.dashboard.deleteAccount("some reason here");
Disable your account.
Kind: instance method of Dashboard
Example
client.dashboard.disableAccount();
Restore your account.
Kind: instance method of Dashboard
Example
client.dashboard.restoreAccount();
FatalError ⇐ BaseError
Kind: global class
Extends: BaseError
- FatalError ⇐
BaseError
- new FatalError(error)
- .type :
string
Represents a fatal error from the Client.
Param | Type | Description |
---|---|---|
error | string | error |
error object or message |
error type
Kind: instance property of FatalError
APIError ⇐ BaseError
Kind: global class
Extends: BaseError
- APIError ⇐
BaseError
- new APIError(error, response, status, method, url)
- .status :
string
- .method :
string
- .url :
string
- .type :
string
Represents an error from the API.
Param | Type | Description |
---|---|---|
error | string | error |
error message |
response | object |
error response |
status | string |
status type of the request |
method | string |
method used for the request |
url | string |
url of the request to the endpoint |
status type of the request
Kind: instance property of APIError
method used for the request
Kind: instance property of APIError
url of the request to the endpoint
Kind: instance property of APIError
error type
Kind: instance property of APIError
ParseError ⇐ BaseError
Kind: global class
Extends: BaseError
- ParseError ⇐
BaseError
- new ParseError(message, status, method, url)
- .status :
string
- .method :
string
- .url :
string
- .type :
string
Represents a parsing error.
Param | Type | Description |
---|---|---|
message | String |
error message |
status | String |
status type of the request |
method | String |
method used for the request |
url | String |
url of the request to the endpoint |
status type of the request
Kind: instance property of ParseError
method used for the request
Kind: instance property of ParseError
url of the request to the endpoint
Kind: instance property of ParseError
error type
Kind: instance property of ParseError
Kind: global class
- PiggyBox
- new PiggyBox()
- .API_URL :
string
- .login(authCookies) ⇒
Object
- .getCSRF(authCookies) ⇒
Promise.<Object>
- .downloads() ⇒
Promise.<Object>
- .paymentMethods() ⇒
Promise.<Object>
- .userData() ⇒
Promise.<Object>
- .devices() ⇒
Promise.<Object>
- .transactions() ⇒
Promise.<Object>
- .stats() ⇒
Promise.<Object>
- .referrals() ⇒
Promise.<Object>
- .counters() ⇒
Promise.<Object>
- .promotions() ⇒
Promise.<Object>
- .notifications() ⇒
Promise.<Object>
- .linkDevice(uuid) ⇒
Promise.<Object>
- .setPaymentDetails(email, method) ⇒
Promise.<Object>
- .redeem(email, method) ⇒
Promise.<Object>
- .removeAutoRedeem() ⇒
Promise.<Object>
- .logout() ⇒
Promise.<Object>
- .rename(uuid, name) ⇒
Promise.<Object>
- .remove(uuid) ⇒
Promise.<Object>
- .hide(uuid) ⇒
Promise.<Object>
- .show(uuid) ⇒
Promise.<Object>
- .usage(step) ⇒
Promise.<Object>
- .devicesStatus(list) ⇒
Promise.<Object>
- .brightvpnReferrals() ⇒
Promise.<Object>
The PiggyBox dashboard client
Example
const dashboard = new PiggyBox();
The base API URL
Kind: instance property of PiggyBox
Log into the dashboard.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
authCookies | Object |
|
authCookies.authMethod | string |
authentication method |
authCookies.oauthRefreshToken | string |
OAuth refresh token |
authCookies.xsrfToken | string |
CSRF token |
Example
client.dashboard.login({ authMethod: "google", oauthRefreshToken: "1%2F%2F0dx...mfz75", xsrfToken: "uE9Tm4sXtk4wHEz4tZFJyANB" });
Get the CSRF token from the dashboard. Automatically sets the CSRF token for future requests.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
authCookies | Object |
|
authCookies.authMethod | string |
authentication method |
authCookies.oauthRefreshToken | string |
OAuth refresh token |
Example
client.dashboard.getCSRF({ authMethod: "google", oauthRefreshToken: "1%2F%2F0dx...mfz75" });
Get the app versions.
Kind: instance method of PiggyBox
Example
client.dashboard.downloads();
Get the available payment methods.
Kind: instance method of PiggyBox
Example
client.dashboard.paymentMethods();
Get your user data.
Kind: instance method of PiggyBox
Example
client.dashboard.userData();
Get user devices.
Kind: instance method of PiggyBox
Example
client.dashboard.devices();
Get user transactions.
Kind: instance method of PiggyBox
Example
client.dashboard.transactions();
Get user stats.
Kind: instance method of PiggyBox
Example
client.dashboard.stats();
Get user referrals.
Kind: instance method of PiggyBox
Example
client.dashboard.referrals();
Get counters before balances update and auto redeem.
Kind: instance method of PiggyBox
Example
client.dashboard.stats();
Get user promotions.
Kind: instance method of PiggyBox
Example
client.dashboard.offers();
Get EarnApp current notifications.
Kind: instance method of PiggyBox
Example
client.dashboard.notifications();
Link a new device to your account.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
Example
client.dashboard.linkDevice("sdk-win-7744606f9f7b42d5b99d11e80f70886c");
Set your payment details.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
string |
paypal / amazon email | |
method | string |
methods: to see methods do client.dashboard.paymentMethods |
Example
client.dashboard.setPaymentDetails("[email protected]", "paypal.com");
Example
client.dashboard.setPaymentDetails("[email protected]", "amazon.com (US/Global)");
Redeem your balance.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
string |
paypal / amazon email | |
method | string |
methods: to see methods do client.dashboard.paymentMethods |
Example
client.dashboard.redeem("[email protected]", "paypal.com");
Example
client.dashboard.redeem("[email protected]", "amazon.com (US/Global)");
Remove auto redeem.
Kind: instance method of PiggyBox
Example
client.dashboard.removeAutoRedeem();
Log out of your account.
Kind: instance method of PiggyBox
Example
client.dashboard.logout();
Rename a device.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
name | string |
new device name |
Example
client.dashboard.rename("sdk-win-7744606f9f7b42d5b99d11e80f70886c", "new name");
Remove a device.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
Example
client.dashboard.remove("sdk-win-7744606f9f7b42d5b99d11e80f70886c");
Hide a device.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
Example
client.dashboard.hide("sdk-win-7744606f9f7b42d5b99d11e80f70886c");
Show a device.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
uuid | string |
device uuid |
Example
client.dashboard.show("sdk-win-7744606f9f7b42d5b99d11e80f70886c");
Get user devices usage.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
step | string |
usage step: daily, weekly, monthly |
Example
client.dashboard.usage("daily");
Get user devices status.
Kind: instance method of PiggyBox
Param | Type | Description |
---|---|---|
list | string |
devices list |
Example
client.dashboard.devicesStatus([ "sdk-node-7744606f9f7b42d5b99d11e80f70886c" ]);
Get user BrightVPN referrals.
Kind: instance method of PiggyBox
Example
client.dashboard.brightvpnReferrals();