Skip to content

Commit

Permalink
Make a few tweaks to TwitterApiCredentials and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dslucas committed Nov 29, 2022
1 parent 755af33 commit d67cb7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 0 additions & 3 deletions docs/2_development.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ The required fields are:
be the server-side key created in [setup](1_setup.md) in GCP
[Credentials](https://console.cloud.google.com/apis/credentials)
- `cloudProjectId`: Your Google Cloud project ID

The optional fields are:

- `twitterApiCredentials`: Your credentials for the Twitter APIs.

All together, your config should look something like one of the two configs
Expand Down
4 changes: 2 additions & 2 deletions src/server/middleware/twitter.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ function loadTwitterData(
}

const auth: AxiosBasicCredentials = {
username: credentials!.username,
password: credentials!.password,
username: credentials.username!,
password: credentials.password!,
};

return axios
Expand Down
11 changes: 8 additions & 3 deletions src/server/serving.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,17 @@ export interface Config {
}

export interface TwitterApiCredentials {
accountName: string;
// The below three fields are necessary if using Enterprise Full-Archive
// Search.
accountName?: string;
password?: string;
username?: string;
// The below two fields are necessary for the Blocks, Mutes, and Hide Replies
// APIs.
appKey: string;
appToken: string;
// Necessary if using v2 Full-Archive Search.
bearerToken?: string;
password: string;
username: string;
}

export interface WebAppCredentials {
Expand Down

0 comments on commit d67cb7c

Please sign in to comment.