Preflight Checklist
Problem Description
Most time, developer only use a little part of the lib, for example, one is developing a sms sender will only use messaging api.
In this case tree shake can remove useless part to reduce the bundle size.
Currently twilio sdk provide a single entrypoint twilioSdk which include all service in it, which make bundler cannot recognize which part is not used, so all the code is include in the bundle.
I do see twilio sdk also export instanceClass like MessageInstance

but the type of paramter is confusing like V2010 need an ApiBase as paramter

and ApiBase use an any

make it hard to use
Proposed Solution
Provide a way to create single service for example:
import { MessageService } from 'twilio';
const service = new MessageService(process.env.ACCOUNT_SID, process.env.AUTH_TOKEN);
const messageInst = await service.create({to:"xx", messagingServiceSid:process.env.MESSAGING_SID, body:"yy"});
Alternatives Considered
Other way it to make a breaking change to the implementation of entry, remove all service from it, only use it as meta configuration, pass it to service function when send request, like
import twilio from 'twilio';
import { MessageService } from 'twilio';
const client= twilio(process.env.ACCOUNT_SID, process.env.AUTH_TOKEN);
const service = new MessageService(client);
const messageInst = await service.create({to:"xx", messagingServiceSid:process.env.MESSAGING_SID, body:"yy"});
Additional Information
No response
Preflight Checklist
Problem Description
Most time, developer only use a little part of the lib, for example, one is developing a sms sender will only use messaging api.



In this case tree shake can remove useless part to reduce the bundle size.
Currently twilio sdk provide a single entrypoint twilioSdk which include all service in it, which make bundler cannot recognize which part is not used, so all the code is include in the bundle.
I do see twilio sdk also export instanceClass like MessageInstance
but the type of paramter is confusing like V2010 need an ApiBase as paramter
and ApiBase use an any
make it hard to use
Proposed Solution
Provide a way to create single service for example:
Alternatives Considered
Other way it to make a breaking change to the implementation of entry, remove all service from it, only use it as meta configuration, pass it to service function when send request, like
Additional Information
No response