Skip to content

Commit

Permalink
Publicly expose type for endpoint / authToken
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyPesse committed Dec 27, 2023
1 parent c316115 commit 9f7a75e
Show file tree
Hide file tree
Showing 2 changed files with 16 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
12 changes: 11 additions & 1 deletion packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ interface GitBookAPIErrorResponse {
export class GitBookAPI extends Api<{
authToken?: string;
}> {
private endpoint: string;

Check failure on line 20 in packages/api/src/index.ts

View workflow job for this annotation

GitHub Actions / lint (18.x)

Delete `⏎`
/**
* 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 +89,7 @@ export class GitBookAPI extends Api<{
});

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

Expand Down

0 comments on commit 9f7a75e

Please sign in to comment.