Skip to content

Commit 9d70145

Browse files
authored
Merge branch 'main' into fix-esm-types-export
2 parents 131787a + 7d9dd1f commit 9d70145

37 files changed

+3150
-673
lines changed

CHANGES.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
twilio-node changelog
22
=====================
33

4+
[2025-09-30] Version 5.10.2
5+
---------------------------
6+
**Library - Chore**
7+
- [PR #1139](https://github.com/twilio/twilio-node/pull/1139): change oauth token endpoint. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
8+
9+
**Insights**
10+
- Replace `field` with `key` in Request Filters and Response Metadata Filters and for Reports API
11+
12+
13+
[2025-09-25] Version 5.10.1
14+
---------------------------
15+
**Library - Chore**
16+
- [PR #1137](https://github.com/twilio/twilio-node/pull/1137): revert esm changes. Thanks to [@manisha1997](https://github.com/manisha1997)!
17+
- [PR #1132](https://github.com/twilio/twilio-node/pull/1132): Add lib-esm and scripts directories to Dockerfile. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
18+
19+
**Api**
20+
- Added optional parameter `CallerDisplayName` for conference participant outbound
21+
- Updated description for property `to` in the participant create request
22+
23+
424
[2025-09-18] Version 5.10.0
525
---------------------------
626
**Library - Feature**

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ ENV NODE_PATH /usr/local/lib/node_modules
88
COPY src ./src
99
COPY spec ./spec
1010
COPY examples ./examples
11-
COPY lib-esm ./lib-esm
12-
COPY scripts ./scripts
1311
COPY index.* package.json babel.config.js tsconfig.json ./
1412

1513
RUN npm install --unsafe-perm true # Needed to run prepublish as root.

README.md

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ TypeScript is supported for TypeScript version 2.9 and above.
3838

3939
To make sure the installation was successful, try sending yourself an SMS message, like this:
4040

41-
**CommonJS:**
4241
```js
4342
// Your AccountSID and Auth Token from console.twilio.com
4443
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
@@ -55,25 +54,6 @@ client.messages
5554
.then((message) => console.log(message.sid));
5655
```
5756

58-
**ESM/ES6 Modules:**
59-
```js
60-
// Your AccountSID and Auth Token from console.twilio.com
61-
import twilio from 'twilio';
62-
63-
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
64-
const authToken = 'your_auth_token';
65-
66-
const client = twilio(accountSid, authToken);
67-
68-
client.messages
69-
.create({
70-
body: 'Hello from twilio-node',
71-
to: '+12345678901', // Text your number
72-
from: '+12345678901', // From a valid Twilio number
73-
})
74-
.then((message) => console.log(message.sid));
75-
```
76-
7757
After a brief delay, you will receive the text message on your phone.
7858

7959
> **Warning**
@@ -112,48 +92,10 @@ const mainAccountCalls = client.api.v2010.account.calls.list; // SID not specifi
11292
const subaccountCalls = client.api.v2010.account(subaccountSid).calls.list; // SID specified as subaccountSid
11393
```
11494

115-
**ESM/ES6 Modules:**
116-
```javascript
117-
// Your Account SID, Subaccount SID Auth Token from console.twilio.com
118-
import twilio from 'twilio';
119-
120-
const accountSid = process.env.TWILIO_ACCOUNT_SID;
121-
const authToken = process.env.TWILIO_AUTH_TOKEN;
122-
const subaccountSid = process.env.TWILIO_ACCOUNT_SUBACCOUNT_SID;
123-
124-
const client = twilio(accountSid, authToken);
125-
const mainAccountCalls = client.api.v2010.account.calls.list; // SID not specified, so defaults to accountSid
126-
const subaccountCalls = client.api.v2010.account(subaccountSid).calls.list; // SID specified as subaccountSid
127-
```
128-
12995
### Lazy Loading
13096

13197
`twilio-node` supports lazy loading required modules for faster loading time. Lazy loading is enabled by default. To disable lazy loading, simply instantiate the Twilio client with the `lazyLoading` flag set to `false`:
13298

133-
**CommonJS:**
134-
```javascript
135-
// Your Account SID and Auth Token from console.twilio.com
136-
const accountSid = process.env.TWILIO_ACCOUNT_SID;
137-
const authToken = process.env.TWILIO_AUTH_TOKEN;
138-
139-
const client = require('twilio')(accountSid, authToken, {
140-
lazyLoading: false,
141-
});
142-
```
143-
144-
**ESM/ES6 Modules:**
145-
```javascript
146-
// Your Account SID and Auth Token from console.twilio.com
147-
import twilio from 'twilio';
148-
149-
const accountSid = process.env.TWILIO_ACCOUNT_SID;
150-
const authToken = process.env.TWILIO_AUTH_TOKEN;
151-
152-
const client = twilio(accountSid, authToken, {
153-
lazyLoading: false,
154-
});
155-
```
156-
15799
### Enable Auto-Retry with Exponential Backoff
158100

159101
`twilio-node` supports automatic retry with exponential backoff when API requests receive an [Error 429 response](https://support.twilio.com/hc/en-us/articles/360044308153-Twilio-API-response-Error-429-Too-Many-Requests-). This retry with exponential backoff feature is disabled by default. To enable this feature, instantiate the Twilio client with the `autoRetry` flag set to `true`.

examples/example-esm.mjs

Lines changed: 0 additions & 109 deletions
This file was deleted.

lib-esm/index.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

lib-esm/package.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "twilio",
33
"description": "A Twilio helper library",
4-
"version": "5.10.0",
4+
"version": "5.10.2",
55
"author": "API Team <[email protected]>",
66
"contributors": [
77
{
@@ -49,16 +49,13 @@
4949
"typedoc": "^0.28.11"
5050
},
5151
"scripts": {
52-
"test": "npm run test:javascript && npm run test:typescript && npm run test:esm",
52+
"test": "npm run test:javascript && npm run test:typescript",
5353
"test:javascript": "jest spec --coverage --detectOpenHandles --testPathIgnorePatterns=spec/cluster",
5454
"test:typescript": "tsc --noEmit",
55-
"test:esm": "node scripts/verify-esm.js",
5655
"jshint": "jshint src/rest/** src/base/** src/http/**",
5756
"jscs": "eslint src/base/**/**.js src/http/**/**.js --fix",
5857
"prepublish": "npm run build",
59-
"build": "npm run build:cjs && npm run build:esm && npm run prettier",
60-
"build:cjs": "tsc",
61-
"build:esm": "node scripts/build-esm.js",
58+
"build": "tsc",
6259
"check": "npm run jshint && npm run jscs",
6360
"ci": "npm run test && npm run nsp && npm run prettier-check",
6461
"nsp": "npm audit --production",
@@ -68,12 +65,10 @@
6865
},
6966
"files": [
7067
"lib",
71-
"lib-esm",
7268
"index.js",
7369
"index.d.ts"
7470
],
7571
"main": "./lib",
76-
"module": "./lib-esm/index.js",
7772
"types": "./index.d.ts",
7873
"exports": {
7974
".": {

0 commit comments

Comments
 (0)