Skip to content

Commit c1eab0e

Browse files
authored
add note for esm (#22)
1 parent a32a24d commit c1eab0e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ exports.handler = moesif(moesifOptions, exports.handler);
7171

7272
```
7373

74+
Depends on which version of node, you can also import directly.
75+
76+
```javascript
77+
import moesif from 'moesif-aws-lambda'
78+
```
79+
80+
If you are using ESM or later version of ESM. There are few other ways of importing:
81+
82+
```javascript
83+
const moesifImportWrapper = await import('moesif-aws-lambda');
84+
const moesif = moesifImportWrapper.default;
85+
```
86+
7487
### 2. Enter Moesif Application Id
7588
Your Moesif Application Id can be found in the [_Moesif Portal_](https://www.moesif.com/).
7689
After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.

0 commit comments

Comments
 (0)