<?php
/**
 * نمونهٔ استفاده از SixThreeSixShortLink.php
 *
 * کلید را از متغیر محیطی بخوان، نه از داخل همین فایل.
 */
declare(strict_types=1);

require __DIR__.'/SixThreeSixShortLink.php';

$api = new SixThreeSixShortLink(
    'https://636.ir',
    getenv('SIX36_API_TOKEN') ?: ''
);

try {
    $link = $api->create(
        'https://example.com/page',
        'عنوان نمونه',
        // code: 'my-code',   // اختیاری
        // brand: 'username', // اختیاری؛ پیش‌فرض برند اصلی
    );
    echo $link['short_url'], PHP_EOL;
} catch (SixThreeSixShortLinkException $e) {
    fwrite(STDERR, $e->getMessage().PHP_EOL);
    exit(1);
}
