PHP code example of freemius / php-sdk

1. Go to this page and download the library: Download freemius/php-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

freemius / php-sdk example snippets


  define( 'FS__API_SCOPE', 'developer' );
  define( 'FS__API_ENTITY_ID', 1234 );
  define( 'FS__API_PUBLIC_KEY', 'pk_YOUR_PUBLIC_KEY' );
  define( 'FS__API_SECRET_KEY', 'sk_YOUR_SECRET_KEY' );
  
  // Init SDK.
  $api = new Freemius_Api(FS__API_SCOPE, FS__API_ENTITY_ID, FS__API_PUBLIC_KEY, FS__API_SECRET_KEY);
  
  // Get all products.
  $result = $api->Api('/plugins.json');
  
  // Load 1st product data.
  $first_plugin_id = $result->plugins[0]->id;
  $first_plugin = $api->Api("/plugins/{$first_plugin_id}.json");
  
  // Update title.
  $api->Api("/plugins/{$first_plugin_id}.json", 'PUT', array(
    'title' => 'My New Title',
  ));