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

Document the subdomain constructor property #7

Open
dandv opened this issue Feb 20, 2018 · 1 comment
Open

Document the subdomain constructor property #7

dandv opened this issue Feb 20, 2018 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@dandv
Copy link
Collaborator

dandv commented Feb 20, 2018

Haven't seen this in the other Twitter libraries. Presumably it would help with issues like ttezel/twit#415, though it's probably better to abstract the resource subdomains from the user.

@dylanirlbeck dylanirlbeck added enhancement New feature or request help wanted Extra attention is needed labels Feb 20, 2020
@dylanirlbeck
Copy link
Contributor

@dandv It's been a while for this issue, but I think you make an important point. What is the best way to handle Twitter endpoints that don't start with api.twitter.com (for example, publish.twitter.com). Right now we just pass in a string to the constructor like this:

const client = new Twitter({
  subdomain: "api", // this could be "publish", for example
  consumer_key: "abc", // from Twitter.
  consumer_secret: "def", // from Twitter.
  access_token_key: "uvw", // from your User (oauth_token)
  access_token_secret: "xyz" // from your User (oauth_token_secret)
});

When you say "it's probably better to abstract the resource subdomains from the user", what do you have in mind? Would we want a full-fledged object that corresponds to each subdomain like this?

// instead of
client.get("statuses/show", {...})

// we have
client.statuses.show({...})

Let me know what you had in mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

2 participants