'chat', 'aud' => 'jitsi', 'exp' => time() + $EXP_DELAY_SEC, 'nbf' => time() - $NBF_DELAY_SEC, 'room' => "*", 'sub' => $APP_ID, 'context' => [ 'user' => [ 'moderator' => $USER_IS_MODERATOR ? "true" : "false", 'email' => $USER_EMAIL, 'name' => $USER_NAME, 'avatar' => $USER_AVATAR_URL, 'id' => $USER_ID ], 'features' => [ 'recording' => $RECORDING_IS_ENABLED ? "true" : "false", 'livestreaming' => $LIVESTREAMING_IS_ENABLED ? "true" : "false", 'transcription' => $TRANSCRIPTION_IS_ENABLED ? "true" : "false", 'outbound-call' => $OUTBOUND_IS_ENABLED ? "true" : "false" ] ] ]); $jws = $jwsBuilder ->create() ->withPayload($payload) ->addSignature($jwk, [ 'alg' => 'RS256', 'kid' => $API_KEY, 'typ' => 'JWT' ]) ->build(); $serializer = new CompactSerializer(); $token = $serializer->serialize($jws, 0); return $token; } }