<?php

chdir('..');
require 'vendor/autoload.php';

use Firebase\JWT\JWT;

$teamId = 'JR363FEY8R';
$keyId = 'W5WTWC9DTJ';
$sub = 'com.wrenchboard.users.client';
$aud = 'https://appleid.apple.com'; // it's a fixed URL value

$iat = strtotime('now');
$exp = strtotime('+60days');
$keyContent = file_get_contents('/home/oameye/AuthKey_W5WTWC9DTJ.p8');

echo JWT::encode([
    'iss' => $teamId,
    'iat' => $iat,
    'exp' => $exp,
    'aud' => $aud,
    'sub' => $sub,
], $keyContent, 'ES256', $keyId);

// Write the snippet in a method, return the value from that method

// You

?>