Getting in an exception for get product detail by id in woocommerce REST api

I have resolve that error by add following line in code.

‘query_string_auth’ => true

code should be like below

 // Local Server
$woocommerce = new Client(
    'https://exmapledomain.com/', 
    'key1', 
    'key2',
    [
        'wp_api' => true,
        'timeout' => 45000,
        'version' => 'wc/v3',
        'query_string_auth' => true,
    ]
);