Skip to content

Commit 9f7a75e

Browse files
committed
Publicly expose type for endpoint / authToken
1 parent c316115 commit 9f7a75e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.changeset/four-keys-double.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/api': minor
3+
---
4+
5+
Publicly expose type for endpoint / authToken

packages/api/src/index.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@ interface GitBookAPIErrorResponse {
1717
export class GitBookAPI extends Api<{
1818
authToken?: string;
1919
}> {
20-
private endpoint: string;
20+
21+
/**
22+
* Endpoint used by the API client.
23+
*/
24+
public readonly endpoint: string;
25+
26+
/**
27+
* Authentication token used by the API client.
28+
*/
29+
public readonly authToken: string | undefined;
2130

2231
constructor(
2332
options: {
@@ -80,6 +89,7 @@ export class GitBookAPI extends Api<{
8089
});
8190

8291
this.endpoint = endpoint;
92+
this.authToken = authToken;
8393
this.setSecurityData({ authToken });
8494
}
8595

0 commit comments

Comments
 (0)