-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Tell us about your feature request
We are using the Paddle SDK on our AWS Lambdas, and only need a couple endpoints. We don't deal with reports, looking up addresses and the like, but pulling in this package makes any kind of tree-shaking impossible.
Moving to a more composable SDK, where each endpoint or resource can be instantiated when needed, would reduce our bundle size.
What problem are you looking to solve?
The main Paddle SDK is using a class-based approach, that creates all nested resources internally. This means that all resources will be bundled, whether they're needed or not.
I would prefer if each resource could be created with a reference to the main Paddle instance itself. That way one can pick and choose which bits to keep.
We also do event processing on our end (via webhooks), but only care about specific events. However, the event handling requires all event types to be bundled in our final output - even the ones we don't care or listen to.
Additional context
Some suggestions:
import { Paddle, Products } from '@paddle/paddle-node-sdk'
const paddle = new Paddle('API_KEY');
const products = new Products(paddle);
const list = products.list();import { Webhooks, subscriptionCreatedEvent, subscriptionUpdatedEvent } from '@paddle/paddle-node-sdk'
const webhooks = new Webhooks(paddle, {
events: [
subscriptionCreatedEvent,
subscriptionUpdatedEvent,
],
});
const data = webhooks.unsmarshal(...);Adding hints for certain methods being pure or without side-effects might also help.
How important is this suggestion to you?
Important