clarkio / vscode-twitch-highlighter

This is a VS Code extension that will allow your Twitch chat to highlight a line of code via a command message. Example: `!line 8 server.js`. See master branch README.md for more details
https://clarkio.com
203 stars 14 forks source link

Added a CredentialManager to save our secrets #24

Closed parithon closed 5 years ago

parithon commented 5 years ago

Added files

credentialManager.ts

I added a credentialManager.ts to set and retrieve the ClientId and Token from the users keychain (credential store). This uses a node module (keytar) but loads it using VSCode's version of Node.

Changed files

package.json

I added 4 commands:

extension.ts

I setup the registration of the commands and created the handlers I changed the startChatHandler to first retrieve the TwitchCredentials from the CredentialManager before starting the client

server.ts

I declared the ttvChatClient within the connection.onInitialize function so we can initialize the twitchCredentials prior to retrieving the twitch chat options I changed the getTwitchChatOptions function to get the password and clientId from twitchCredentials