Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use less generic env variables #3

Open
nhoizey opened this issue May 20, 2020 · 2 comments
Open

Use less generic env variables #3

nhoizey opened this issue May 20, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@nhoizey
Copy link
Collaborator

nhoizey commented May 20, 2020

The environment variable names are really generic:
https://github.com/KyleMit/eleventy-plugin-embed-tweet/blob/master/twitter.js#L56-L69

I have keys for multiple services in my .env file, so it would be better having a more distinctive name for these for Twitter.

Here are the names in Twitter's UI:
image

I suggest using these names, so follow Twitter naming:

current name   new name
TOKEN TWITTER_ACCESS_TOKEN
TOKEN_SECRET TWITTER_ACCESS_TOKEN_SECRET
CONSUMER_KEY TWITTER_API_KEY
CONSUMER_SECRET TWITTER_API_SECRET_KEY

If you agree with this, I can make a PR to use new names AND still support current ones for compatibility.

@KyleMit
Copy link
Owner

KyleMit commented Jul 15, 2020

I like this change. We'll have to either support the old keys, with priority to new names and then fallback to older names, or revision as a breaking change. Not sure how many people are genuinely using this repo - and it's not a big lift to rename some properties. I wonder if we could code mod them over, but there just doesn't seem to be enough there to want to have users run a script to fix stuff.

@nhoizey
Copy link
Collaborator Author

nhoizey commented Jul 15, 2020

I think you could support older names for a while, with a message in the console to show they're deprecated.

@KyleMit KyleMit added the enhancement New feature or request label Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants