Skip to content

Commit 4cd41b0

Browse files
committed
added new example to get active sites
1 parent 2c8dc9a commit 4cd41b0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

examples/developer-examples.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,28 @@ process.stdout.write('\033c');
1313
//getAllPluginVersions();
1414
//getAllPluginDetails();
1515
getSpecificPluginDetails(FS__API_PLUGIN_ID);
16+
//getActiveSites();
1617
//downloadSpecificPluginZip(14418); // not currently working
1718
//updatePluginTitle('New Plugin Title!');
1819
//deployPluginZip('freemius.zip'); // not tested yet
1920
//findClockDiff();
2021

2122
// DEVELOPER SCOPE BASED REQUESTS
2223

24+
// Get active sites for a particular plugin
25+
// API - https://freemius.docs.apiary.io/#reference/installs-/-a.k.a.-sites/installs-collection/retrieve-installs
26+
function getActiveSites() {
27+
developer.Api('/plugins/' + FS__API_PLUGIN_ID + '/installs.json', 'GET', [], [], function (sites) {
28+
// list active sites
29+
console.log(JSON.parse(sites));
30+
31+
// list just the active site URLs
32+
JSON.parse(sites).installs.forEach(function(site) {
33+
console.log(site.url);
34+
});
35+
});
36+
}
37+
2338
// Get all plugin versions
2439
// API - https://freemius.docs.apiary.io/#reference/deployment/plugin-tagsversions/list-all-tags
2540
function getAllPluginVersions() {

0 commit comments

Comments
 (0)