@@ -4,14 +4,11 @@ import { retry, sleep } from './utils'
4
4
import Long from 'long'
5
5
import AuthCache from './authn/AuthCache'
6
6
import { Authenticator } from './authn'
7
- import { version } from '../package.json'
8
7
export const { MessageApi, SortDirection } = messageApi
9
8
10
9
const RETRY_SLEEP_TIME = 100
11
10
const ERR_CODE_UNAUTHENTICATED = 16
12
11
13
- const clientVersionHeaderKey = 'X-Client-Version'
14
-
15
12
export type GrpcError = Error & { code ?: number }
16
13
17
14
export type QueryParams = {
@@ -80,12 +77,10 @@ export default class ApiClient {
80
77
pathPrefix : string
81
78
maxRetries : number
82
79
private authCache ?: AuthCache
83
- version : string
84
80
85
81
constructor ( pathPrefix : string , opts ?: ApiClientOptions ) {
86
82
this . pathPrefix = pathPrefix
87
83
this . maxRetries = opts ?. maxRetries || 5
88
- this . version = 'xmtp-js/' + version
89
84
}
90
85
91
86
// Raw method for querying the API
@@ -99,9 +94,6 @@ export default class ApiClient {
99
94
{
100
95
pathPrefix : this . pathPrefix ,
101
96
mode : 'cors' ,
102
- headers : new Headers ( {
103
- [ clientVersionHeaderKey ] : this . version ,
104
- } ) ,
105
97
} ,
106
98
] ,
107
99
this . maxRetries ,
@@ -125,7 +117,6 @@ export default class ApiClient {
125
117
mode : 'cors' ,
126
118
headers : new Headers ( {
127
119
Authorization : `Bearer ${ authToken } ` ,
128
- [ clientVersionHeaderKey ] : this . version ,
129
120
} ) ,
130
121
} ,
131
122
] ,
@@ -160,9 +151,6 @@ export default class ApiClient {
160
151
pathPrefix : this . pathPrefix ,
161
152
signal : abortController . signal ,
162
153
mode : 'cors' ,
163
- headers : new Headers ( {
164
- [ clientVersionHeaderKey ] : this . version ,
165
- } ) ,
166
154
} ) . catch ( async ( err : GrpcError ) => {
167
155
if ( isAbortError ( err ) ) {
168
156
return
0 commit comments