Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/ConvertKit_API.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
*/
class ConvertKit_API
{
/**
* The SDK version.
*
* @var string
*/
public const VERSION = '1.0.0';

/**
* ConvertKit API Key
*
Expand Down Expand Up @@ -95,7 +102,15 @@ public function __construct(string $api_key, string $api_secret, bool $debug = f
$this->api_key = $api_key;
$this->api_secret = $api_secret;
$this->debug = $debug;
$this->client = new Client();

// Specify a User-Agent for API requests.
$this->client = new Client(
[
'headers' => [
'User-Agent' => 'ConvertKitPHPSDK/' . self::VERSION . ';PHP/' . phpversion(),
],
]
);

if ($debug) {
$this->debug_logger = new Logger('ck-debug');
Expand Down