Adrià Vilanova MartÃnez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | /** |
| 6 | * @fileoverview Creates a globally shared instance of AutoRefreshPrpcClient |
| 7 | * to be used across the frontend, to share state and allow easy test stubbing. |
| 8 | */ |
| 9 | |
| 10 | import AutoRefreshPrpcClient from 'prpc.js'; |
| 11 | |
| 12 | // TODO(crbug.com/monorail/5049): Remove usage of window.CS_env here. |
| 13 | export const prpcClient = new AutoRefreshPrpcClient( |
| 14 | window.CS_env ? window.CS_env.token : '', |
| 15 | window.CS_env ? window.CS_env.tokenExpiresSec : 0, |
| 16 | ); |