-
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
Add support for low-level request method #6
Milestone
Comments
benmvp
referenced
this issue
in benmvp/eventbrite-sdk-javascript
Feb 28, 2018
Adds `sdk.request(url, fetchOptions)` that can be used to make any API request without having a convience method for it. It reads in the `token` & `baseUrl` properties that are passed in while creating the `sdk` object in order to generate the full URL. Sample usage: ```js const sdk = require('eventbrite')({token: 'OATH_TOKEN_HERE'}); // See: https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id sdk.request('/users/me').then(res => { // handle response data }); ``` Also: - Renamed package from `brite-rest` to `eventbrite` - Updated README to reflect sample usage - Moved `index.spec.ts` into `__tests__` folder - Had to disable `camelcase` ESLint rule because Prettier was unquoting non-conforming property names and the `camelcase` rule doesn't have fix functionality for prettier-eslint to fix NOTE: Per https://www.eventbrite.com/developer/v3/api_overview/authentication/#ebapi-authenticating-requests we should move the token into an authorization header instead of a query parameter, which is preferred. It'd also allow us to remove the `url-lib` dependency. Fixes #6.
BenAtEventbrite
pushed a commit
that referenced
this issue
Mar 1, 2018
Adds `sdk.request(url, fetchOptions)` that can be used to make any API request without having a convience method for it. It reads in the `token` & `baseUrl` properties that are passed in while creating the `sdk` object in order to generate the full URL. Sample usage: ```js const eventbrite = require('eventbrite'); // Create configured Eventbrite SDK const sdk = eventbrite({token: 'OATH_TOKEN_HERE'}); // See: https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id sdk.request('/users/me').then(res => { // handle response data }); ``` Also: - Renamed package from `brite-rest` to `eventbrite` - Updated README to reflect sample usage - Moved `index.spec.ts` into `__tests__` folder - Had to disable `camelcase` ESLint rule because Prettier was unquoting non-conforming property names and the `camelcase` rule doesn't have fix functionality for prettier-eslint to fix - Added a bunch of `eslint-plugin-typescript` rules NOTE: Per https://www.eventbrite.com/developer/v3/api_overview/authentication/#ebapi-authenticating-requests we should move the token into an authorization header instead of a query parameter, which is preferred. It'd also allow us to remove the `url-lib` dependency (and the one-off Typescript definition file). Fixes #6
🎉 This issue has been resolved in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add a
request(url, fetchOptions)
low-level method that can be used to make any API request without having any special method for it. It will need to support the optionaltoken
&baseUrl
properties that can be passed in when configuring the SDK object.Something like:
Eventually all of the endpoint methods in the SDK will call this low-level request method.
The text was updated successfully, but these errors were encountered: