Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Nylas Java SDK Changelog

### Unreleased
* Added support for Notetaker APIs
* Added support for Notetaker via the calendar and event APIs

### [2.7.0] - Release 2025-03-03
* Added support for listing import events via `events.listImportEvents()`
* Added sandbox to the Environment Enum
Expand Down
11 changes: 11 additions & 0 deletions examples/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Nylas API Key - Required
# Get it from your Nylas Dashboard: https://dashboard.nylas.com/
NYLAS_API_KEY=your_api_key_here

# Meeting Link - Required for Notetaker examples
# This should be a link to a Zoom, Google Meet, or Microsoft Teams meeting
MEETING_LINK=your_meeting_link_here

# Nylas API URI - Optional (defaults to https://api.us.nylas.com)
# Only change this if instructed by Nylas support
NYLAS_API_URI=https://api.us.nylas.com
33 changes: 33 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Compiled class files
*.class

# Build output
/build/

# Gradle files
.gradle/

# IntelliJ IDEA files
.idea/
*.iml
*.iws
*.ipr
out/

# Eclipse files
.classpath
.project
.settings/
bin/

# VS Code files
.vscode/

# Environment variables
.env

# Mac files
.DS_Store

# Logs
*.log
23 changes: 23 additions & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.PHONY: help list java kotlin

# Default target
help:
@echo "Nylas Java/Kotlin SDK Examples"
@echo ""
@echo "Available targets:"
@echo " help - Show this help message"
@echo " list - List available examples"
@echo " java - Run the Java Notetaker example"
@echo " kotlin - Run the Kotlin Notetaker example"

# List available examples
list:
@cd .. && ./gradlew :examples:listExamples

# Run the Java example
java:
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.NotetakerExample

# Run the Kotlin example
kotlin:
@cd .. && ./gradlew :examples:run -PmainClass=com.nylas.examples.KotlinNotetakerExampleKt
94 changes: 94 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Nylas Java/Kotlin SDK Examples

Simple examples demonstrating how to use the Nylas Java/Kotlin SDK.

## Available Examples

### Notetaker Example

The `NotetakerExample` demonstrates how to use the Nylas Java/Kotlin SDK to interact with the Notetakers API:

- Invite a Notetaker to a meeting
- List all Notetakers
- Get media from a Notetaker (if available)
- Leave a Notetaker session

## Setup

### 1. Environment Setup

Copy the `.env.example` file to `.env` and fill in your credentials:

```bash
cp .env.example .env
```

Edit the `.env` file with your details:
```
# Get your API key from the Nylas Dashboard
NYLAS_API_KEY=your_api_key_here

# Add your meeting link (Zoom, Google Meet, or Microsoft Teams)
MEETING_LINK=your_meeting_link_here
```

### 2. Running the Examples

#### Option 1: Using Gradle

Run Java example:
```bash
./gradlew :examples:run -PmainClass=com.nylas.examples.NotetakerExample
```

Run Kotlin example:
```bash
./gradlew :examples:run -PmainClass=com.nylas.examples.KotlinNotetakerExampleKt
```

#### Option 2: Using the Makefile

List available examples:
```bash
make list
```

Run the Java example:
```bash
make java
```

Run the Kotlin example:
```bash
make kotlin-way
```

#### Option 3: From an IDE

1. Open the project in your IDE (IntelliJ IDEA, Eclipse, etc.)
2. Set the required environment variables in your run configuration
3. Run the main method in either:
- `NotetakerExample.java` (Java)
- `KotlinNotetakerExample.kt` (Kotlin)

## Project Structure

```
examples/
├── .env.example # Template for environment variables
├── build.gradle.kts # Gradle build file for examples
├── Makefile # Helpful commands for running examples
├── README.md # This file
└── src/
└── main/
├── java/ # Java examples
│ └── com/nylas/examples/
│ └── NotetakerExample.java
└── kotlin/ # Kotlin examples
└── com/nylas/examples/
└── KotlinNotetakerExample.kt
```

## Additional Information

For more information about the Nylas API, refer to the [Nylas API documentation](https://developer.nylas.com/).
70 changes: 70 additions & 0 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("java")
id("application")
id("org.jetbrains.kotlin.jvm") version "1.8.21"
}

group = "com.nylas.examples"
version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
mavenLocal() // For local Nylas SDK development
}

dependencies {
// Add the Nylas SDK dependency
implementation(project(":")) // References the main Nylas SDK project

// Core dependencies
implementation("org.json:json:20230227")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")

// Test dependencies
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}

application {
// The mainClass will be overridden by the -PmainClass command-line parameter
mainClass.set(findProperty("mainClass") as String? ?: "com.nylas.examples.NotetakerExample")
}

tasks.test {
useJUnitPlatform()
}

// Task to list available examples
tasks.register("listExamples") {
doLast {
println("Available examples:")
println("- Java: com.nylas.examples.NotetakerExample")
println("- Kotlin: com.nylas.examples.KotlinNotetakerExampleKt")
println("\nRun an example with: ./gradlew :examples:run -PmainClass=<example class name>")
}
}

// Configure source sets for Java and Kotlin
sourceSets {
main {
java {
srcDir("src/main/java")
}
kotlin {
srcDir("src/main/kotlin")
}
}
}
Loading
Loading