-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support full API url in request() #47
Comments
Hi @deremer thanks for the suggestion! Technically the SDK does support passing a full API url to const eventbrite = require('eventbrite');
// Create configured Eventbrite SDK
const sdk = eventbrite({
token: 'OATH_TOKEN_HERE',
baseUrl: '',
});
const fullUrl = 'https://www.eventbriteapi.com/v3/users/me';
sdk.request(fullUrl).then(res => {
// handle response data
}); Would that work for you? |
@benmvp Oh great! Yes, that works. 💯 Might I suggest adding that to the README? It's specifically useful to teams also using the webhooks. Thank you for the response. |
It was requested in #47 to add support to `.request()` for full URLs because [webooks](https://www.eventbrite.com/developer/v3/api_overview/webhooks/) returns full API urls. However instead of updating `.request()` a client can just set the `baseUrl` to empty string (`''`) when configuring the SDK object. This adds docs and an example for future users. Closes #47.
Glad to help. That's also a great idea! Done! |
It was requested in #47 to add support to `.request()` for full URLs because [webooks](https://www.eventbrite.com/developer/v3/api_overview/webhooks/) returns full API urls. However instead of updating `.request()` a client can just set the `baseUrl` to empty string (`''`) when configuring the SDK object. This adds docs and an example for future users. Closes #47.
🎉 This issue has been resolved in version 1.0.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
At the moment I don't have time to do a PR, but I wanted to share this as it easy enough that your internal team may be able to implement it quickly.
Current Behavior
The webhooks generated by Eventbrite provide an
api_url
which is a full URL. In order to use this with this SDK, we need to extract that path after/v3
. This is potentially brittle.Expected Behavior
.request()
should also support valid full API URLs. Or alternatively, perhaps the webhooks could return something likeapi_endpoint
Possible Solution
If the url matches the regex
^https://www.eventbriteapi.com/v3/
use the url provided.I.e., Somewhere around here do:
where
urlRegex
is the valid API url regex to match.The text was updated successfully, but these errors were encountered: