Skip to content

Quickstart: Nylas Connect

Add email, calendar, and contacts to your app in minutes. Just a few lines of code. No token management. Works with your existing auth.

Traditional email integration means weeks of OAuth implementation, token refresh logic, security reviews, and edge case handling. With Nylas Connect, it’s three lines of code.

This quickstart will walk you through integrating Nylas Connect with your existing identity provider (IDP). You’ll authenticate users through your IDP, connect their email accounts, and make API calls using your IDP tokens—no separate Nylas authentication or complex token management required.

Before you begin, make sure you have:

  • Nylas Developer Account: Sign up here if you don’t have one
  • Identity Provider Account: Auth0, Clerk, Google Identity, WorkOS, or any IDP with JWKS support
  • Node.js or Browser Environment: For running the examples

First, set up your identity provider. We’ll use Auth0 for this example:

  1. Create an application in your Auth0 Dashboard
  2. Configure these settings:
    • Allowed Callback URLs: http://localhost:3000
    • Allowed Web Origins: http://localhost:3000
  3. Save your Domain and Client ID

Configure IDP settings in your Nylas Dashboard:

  1. Go to Dashboard → Hosted Authentication → Identity Providers
  2. Add these values:
    • Allowed Origins: http://localhost:3000
    • Callback URIs: http://localhost:3000

Install the required packages:

Create your authentication setup:

Replace the placeholder values:

  • <AUTH0_DOMAIN> - Your Auth0 domain (e.g., your-app.us.auth0.com)
  • <AUTH0_CLIENT_ID> - Your Auth0 Client ID
  • <NYLAS_CLIENT_ID> - Your Nylas application’s Client ID from the dashboard

Once authenticated, make Nylas API calls using your IDP token. One user identity. One token. Access to everything:

Verify that the email account is connected:

Your IDP user is now connected to their inbox. You can call Nylas APIs using your existing auth token to access:

Read, send, and search messages. Full inbox access across Gmail, Outlook, Yahoo, and more. Build features like:

  • Inbox management and threading
  • Smart search and filtering
  • Draft handling and attachments
  • Rich text and HTML email composition

Schedule, modify, and sync events. Works with Google Calendar, Outlook, iCloud, and all major providers:

  • Create and manage events
  • Handle availability and scheduling
  • Sync across multiple calendars
  • Manage recurring events and reminders

Unified contact lists from all email providers. One API for everything:

  • Access contacts across providers
  • Create and update contact information
  • Search and filter contacts
  • Manage contact groups

AI-powered transcription, summaries, action items, and insights from every meeting:

  • Automatic meeting transcription
  • AI-generated summaries and action items
  • Speaker identification and analytics
  • Searchable meeting archives

If you’re building a React application, use the @nylas/react library for a better developer experience:

import { useNylasConnect } from '@nylas/react/connect';
import { useAuth0 } from '@auth0/auth0-react';
function MyComponent() {
const { getAccessTokenSilently } = useAuth0();
const { isConnected, connect } = useNylasConnect({
clientId: "<NYLAS_CLIENT_ID>",
redirectUri: window.location.origin + "/callback",
identityProviderToken: async () => {
return await getAccessTokenSilently();
}
});
return (
<button onClick={() => connect({ method: 'popup' })}>
Connect Email
</button>
);
}

See the React IDP integration guide for complete React examples.

🎉 Congratulations! You’ve just integrated email, calendar, and contacts into your app without writing a single OAuth flow or token refresh handler.