You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/README.md
+90-1Lines changed: 90 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,33 @@ This directory contains examples of how to use the Nylas Node.js SDK to interact
4
4
5
5
## Examples
6
6
7
+
### Node.js Examples
8
+
7
9
-[Grants](./grants/README.md) - Examples of how to fetch, list, sort, and filter grants (authenticated connections to email/calendar providers).
8
10
-[Notetakers](./notetakers/README.md) - Examples of how to use the Nylas Notetakers API to invite a Notetaker bot to meetings, get recordings and transcripts, and more.
9
11
-[Messages](./messages/README.md) - Examples of how to use the Nylas Messages API to list, find, send, update messages, and work with new features like tracking options and raw MIME data.
10
12
-[Folders](./folders/README.md) - Examples of how to use the Nylas Folders API, including the new `singleLevel` parameter for Microsoft accounts.
13
+
-[Calendars](./calendars/README.md) - Examples of how to use the Nylas Calendar API to create and manage calendar events with Notetaker integration.
14
+
15
+
### Cloudflare Workers Examples
16
+
17
+
-[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.
18
+
-[Edge Environment](./edge-environment/README.md) - Standard Cloudflare Workers example for sending email attachments. Demonstrates file upload handling and email sending on the edge.
19
+
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
+
24
+
### Module System Examples
25
+
26
+
-[ESM Only](./esm-only/) - Example of using the SDK with ES Modules
27
+
-[CJS Only](./cjs-only/) - Example of using the SDK with CommonJS
11
28
12
29
## Running the Examples
13
30
14
-
To run these examples, you'll need to:
31
+
### Node.js Examples
32
+
33
+
To run the Node.js examples, you'll need to:
15
34
16
35
1. Install dependencies:
17
36
```bash
@@ -52,6 +71,76 @@ To run these examples, you'll need to:
52
71
node dist/messages/messages.js
53
72
```
54
73
74
+
### Cloudflare Workers Examples
75
+
76
+
The Cloudflare Workers examples are self-contained and have their own setup:
77
+
78
+
1. Navigate to the example directory:
79
+
```bash
80
+
cd examples/cloudflare-vite-calendars
81
+
# or
82
+
cd examples/edge-environment
83
+
```
84
+
85
+
2. Install dependencies:
86
+
```bash
87
+
npm install
88
+
```
89
+
90
+
3. Set up environment variables (see each example's README for details):
91
+
```bash
92
+
cp .dev.vars.example .dev.vars
93
+
# Edit .dev.vars with your Nylas credentials
94
+
```
95
+
96
+
4. Run the development server:
97
+
```bash
98
+
npm run dev
99
+
```
100
+
101
+
5. Deploy to Cloudflare (optional):
102
+
```bash
103
+
npm run deploy
104
+
```
105
+
106
+
Each Cloudflare example has its own comprehensive README with detailed instructions.
107
+
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
+
55
144
## Documentation
56
145
57
146
For more information, see the [Nylas API Documentation](https://developer.nylas.com/).
0 commit comments