Giter Club home page Giter Club logo

nylas-java's Introduction

Aimeos logo

Nylas SDK for Kotlin & Java

Maven Central Version codecov

This is the GitHub repository for the Nylas SDK for Kotlin and Java. This repo is primarily for anyone who wants to make contributions to the SDK or install it from source. For documentation on how to use this SDK to access the Nylas Email, Calendar, or Contacts APIs, see the official Java SDK Quickstart Guide.

The Nylas Communications Platform provides REST APIs for Email, Calendar, and Contacts, and the Nylas SDK is the quickest way to build your integration using Kotlin or Java.

Here are some resources to help you get started:

If you have a question about the Nylas Communications Platform, contact Nylas Support for help.

⚙️ Install

Note: The Nylas SDK for Kotlin & Java requires JRE 8 or later.

Set up using Gradle

If you're using Gradle, add the following to the dependencies section of build.gradle:

implementation("com.nylas.sdk:nylas:2.3.1")

Build from source

To build from source, clone this repo and build the project with Gradle.

git clone https://github.com/nylas/nylas-java.git && cd nylas-java
./gradlew build uberJar

This creates a new jar file in build/libs/nylas-java-sdk-2.3.1-uber.jar.

See the Gradle documentation on Building Libraries or the Gradle User Manual for more information.

⚡️Usage

To use this SDK, you must first get a free Nylas account.

Then, follow the Quickstart guide to set up your first app and get your API keys.

For code examples that demonstrate how to use this SDK, take a look at our Java repos in the Nylas Samples collection.

🚀 Making Your First Request

You use the NylasClient object to make requests to the Nylas API. The SDK is organized into different resources, each of which has methods to make requests to the API. Each resource is available through the NylasClient object configured with your API key.

For example, to get a list of calendars, you can use the following code:

NylasClient nylas = new NylasClient.Builder("API_KEY").build();
ListResponse<Calendars> calendars = nylas.calendars().list("GRANT_ID");

📚 Documentation

Nylas maintains a reference guide for the Kotlin and Java SDK to help you get familiar with the available methods and classes.

✨ Upgrading from 1.x

See UPGRADE.md for instructions on upgrading from 1.x to 2.x.

Note: The Kotlin/Java SDK 2.x is not compatible with the Nylas API earlier than v3-beta.

🪵 Logging

The SDK uses SLF4J for logging. If you are using the SDK you can choose what logging framework to use with it for your app.

Common choices are log4j, logback, java.util.logging. If the application doesn't specify any logging framework, SLF4J emits one single warning and is then completely silent.

By default, the HTTP client is configured with the com.nylas.HttpLoggingInterceptor which provides three DEBUG level loggers for HTTP requests.

  • com.nylas.http.Summary logs one line for each request, containing the method, URI, and content size, and one line for each response containing the status code, message, content size and duration.
  • com.nylas.http.Headers logs the request and response HTTP headers (except Authorization value by default).
  • com.nylas.http.Body logs request and response bodies (first 10kB by default).

You can enable or disable these loggers using whatever logging framework you use.

For example, if you're using log4j2 and with an xml configuration file, include this line to enable all three: <Logger name="com.nylas" level="DEBUG"/>

You can configure how you log HTTP Authorization header values and the body size limit using a NylasClient.Builder with a customized HttpLoggingInterceptor

💙 Contributing

We value and appreciate contributors' time! We welcome questions, bug reports, and pull requests.

See the Contributing for information about how to make contributions to this project.

📝 License

This project is licensed under the terms of the MIT license. See the LICENSE for the full terms.

nylas-java's People

Contributors

mrashed-dev avatar ddlatham avatar ricardogeek avatar atejada avatar leminhitalia avatar tdtianzhenjiu avatar kraju3 avatar maxw-nylas avatar nickbair-nylas avatar

Stargazers

�̪̜̳̣͏�̡͚̺͖̣͈̬̥̀ͮ͂͋ͨ́̄͑͌́̍̊̊̆̋̄̀͠͠͠͠҉̴̷̨̡̢̢́̀͘͢J͊̊ͩ̂ͬ̎́͑̋ͬ͒͆ͯ̌ͭ̋̿ͦͩ҉̶̛̕͘̕͟͏̷̵̵̢̀̀͘͜͡͝͡K̘̬̮̓ͨ̔͗̔͑͘͞͏̨̡͢͢͜͝͝͝o̴̷̞̰̩̣̩͚̻̞̩̱̝̲̦ͩͬ͒͑̉ͤ̊̐͛ͥ̽̚͝͡͠R̷̴̡̨̛͇̖̺͚̲̞̠̜̳͚͊ͩͣ̌ͪ̔ͯ̂́̀͘͘͟͟͝͝ͅḛ̗̓ͥ͐͐ͫ͌̃̏́ͤ1̴̴̸̴̴̨̨͆̑ͦͭ͆͑͛͋̑ͯ̕̕͟͟͡͡3͕͙̜̭̥̞̜͙̖̬̯̻͚̮͎͙̼̔ͯͪͅ͏̵̵̢̧́͜͢͟͡҉̢́́̕͢ avatar

Forkers

limitinit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.