Skip to content

Commit

Permalink
Publicly expose type for endpoint / authToken (#330)
Browse files Browse the repository at this point in the history
* Publicly expose type for endpoint / authToken

* Lint
  • Loading branch information
SamyPesse authored Dec 27, 2023
1 parent c316115 commit 73a437c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/four-keys-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/api': minor
---

Publicly expose type for endpoint / authToken
11 changes: 10 additions & 1 deletion packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ interface GitBookAPIErrorResponse {
export class GitBookAPI extends Api<{
authToken?: string;
}> {
private endpoint: string;
/**
* Endpoint used by the API client.
*/
public readonly endpoint: string;

/**
* Authentication token used by the API client.
*/
public readonly authToken: string | undefined;

constructor(
options: {
Expand Down Expand Up @@ -80,6 +88,7 @@ export class GitBookAPI extends Api<{
});

this.endpoint = endpoint;
this.authToken = authToken;
this.setSecurityData({ authToken });
}

Expand Down

0 comments on commit 73a437c

Please sign in to comment.