Skip to content

Commit 9bfac4f

Browse files
committed
Add AWS Lambda examples to README.md, detailing setup and usage for sending email attachments with Nylas SDK
1 parent 95c1130 commit 9bfac4f

File tree

10 files changed

+14481
-0
lines changed

10 files changed

+14481
-0
lines changed

examples/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ This directory contains examples of how to use the Nylas Node.js SDK to interact
1717
- [Cloudflare Vite Calendars](./cloudflare-vite-calendars/README.md) - Modern Cloudflare Workers example using Vite for building a calendar event manager. Showcases listing and creating events with a beautiful web interface.
1818
- [Edge Environment](./edge-environment/README.md) - Standard Cloudflare Workers example for sending email attachments. Demonstrates file upload handling and email sending on the edge.
1919

20+
### AWS Lambda Examples
21+
22+
- [AWS Lambda Attachments](./aws-lambda/README.md) - AWS Lambda example for sending email attachments using the Nylas SDK. Demonstrates how to handle multiple file uploads (including 2+ attachments over 3MB total) without Lambda freezing. Includes interactive setup CLI and Serverless Framework deployment.
23+
2024
### Module System Examples
2125

2226
- [ESM Only](./esm-only/) - Example of using the SDK with ES Modules
@@ -101,6 +105,42 @@ The Cloudflare Workers examples are self-contained and have their own setup:
101105

102106
Each Cloudflare example has its own comprehensive README with detailed instructions.
103107

108+
### AWS Lambda Examples
109+
110+
The AWS Lambda example is self-contained and has its own setup:
111+
112+
1. Navigate to the example directory:
113+
```bash
114+
cd examples/aws-lambda
115+
```
116+
117+
2. Run the interactive setup:
118+
```bash
119+
npm run setup
120+
```
121+
122+
This will guide you through:
123+
- Prerequisites checking
124+
- Nylas credentials configuration
125+
- AWS credentials setup
126+
- Environment variable configuration
127+
- Optional immediate deployment
128+
129+
3. Or set up manually:
130+
```bash
131+
npm install
132+
# Create .env file with your Nylas credentials
133+
# Configure AWS credentials
134+
npm run deploy
135+
```
136+
137+
4. Test the deployed function:
138+
- Visit the API Gateway URL displayed after deployment
139+
- Upload multiple files and send emails
140+
- Test with files totaling over 3MB to verify the bug fix
141+
142+
The AWS Lambda example includes a comprehensive README with detailed instructions and troubleshooting.
143+
104144
## Documentation
105145

106146
For more information, see the [Nylas API Documentation](https://developer.nylas.com/).

examples/aws-lambda/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
dist/
3+
.env
4+
.serverless/
5+
*.log
6+
.DS_Store
7+
lambda-package.zip

0 commit comments

Comments
 (0)