{"id":28473229,"url":"https://github.com/nylas/nylas-react","last_synced_at":"2026-01-20T16:42:43.707Z","repository":{"id":65429351,"uuid":"515333644","full_name":"nylas/nylas-react","owner":"nylas","description":"React SDK for the Nylas Platform API","archived":false,"fork":false,"pushed_at":"2022-07-21T22:01:20.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":34,"default_branch":"main","last_synced_at":"2025-07-02T02:37:54.773Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nylas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-18T20:36:02.000Z","updated_at":"2022-07-22T17:30:23.000Z","dependencies_parsed_at":"2023-01-23T07:25:12.400Z","dependency_job_id":null,"html_url":"https://github.com/nylas/nylas-react","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nylas/nylas-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylas%2Fnylas-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylas%2Fnylas-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylas%2Fnylas-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylas%2Fnylas-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nylas","download_url":"https://codeload.github.com/nylas/nylas-react/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylas%2Fnylas-react/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267285847,"owners_count":24064231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-07T12:06:33.452Z","updated_at":"2026-01-20T16:42:43.701Z","avatar_url":"https://github.com/nylas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://www.nylas.com/\"\u003e\n    \u003cimg src=\"https://brand.nylas.com/assets/downloads/logo_horizontal_png/Nylas-Logo-Horizontal-Blue_.png\" alt=\"Aimeos logo\" title=\"Aimeos\" align=\"right\" height=\"60\" /\u003e\n\u003c/a\u003e\n\n# Nylas React SDK\n\n![npm](https://img.shields.io/npm/v/@nylas/nylas-react)\n\nThis is the GitHub repository for the Nylas React SDK. The Nylas Communications Platform provides REST APIs for [Email](https://developer.nylas.com/docs/connectivity/email/), [Calendar](https://developer.nylas.com/docs/connectivity/calendar/), and [Contacts](https://developer.nylas.com/docs/connectivity/contacts/), and the Node SDK is the quickest way to build your integration using React.\n\nHere are some resources to help you get started:\n\n- [Quickstart](https://developer.nylas.com/docs/the-basics/quickstart/)\n- [Nylas API Reference](https://developer.nylas.com/docs/api/)\n\n\n## ⚙️ Install\n\nTo install the Nylas React SDK, you will first need to have [npm](https://www.npmjs.com/get-npm) installed on your machine.\n\nThen, head to the nearest command line and run the following:\n```bash\nnpm install @nylas/nylas-react\n```\n\nTo install this package from source, clone this repo and run `npm install` from inside the project directory:\n\n```bash\ngit clone https://github.com/nylas/nylas-react.git\ncd nylas-react\nnpm install\n```\n\n## ⚡️ Usage\n\nThe Nylas React SDK provides an easy way to implement authentication in your react application.\n\n### Components\n\nThe Nylas React SDK currently provides the following component:\n\n* [NylasProvider](src/nylas-provider.tsx) - This is a component that utilizes React Context API to maintain a state for authentication and the [Nylas JS](https://github.com/nylas/nylas-js) client. This context can be accessed via the [useNylas](https://github.com/nylas/nylas-react#useNylas) hook.\n\n### Hooks\nThese are the following options that can be passed in to configure an instance of the Nylas JS SDK\n\n* useNylas - returns `Nylas`; an instance of the [Nylas JavaScript SDK](https://github.com/nylas/nylas-js)\n\n### Example\nHere's how you can get started with integrating the React SDK into your application for the purpose of authenticating. For this example we're going to wrap it around the entire app, but feel free to wrap the component where you see fit.\n\n#### index.tsx\n```typescript jsx\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport App from './App';\n\nimport {NylasProvider} from \"@nylas/nylas-react\";\n\nconst root = ReactDOM.createRoot(\n  document.getElementById('root') as HTMLElement\n);\nroot.render(\n  \u003cReact.StrictMode\u003e\n    \u003cNylasProvider serverBaseUrl=\"http://localhost:9000\"\u003e\n      \u003cApp /\u003e\n    \u003c/NylasProvider\u003e\n  \u003c/React.StrictMode\u003e\n);\n```\n\n#### App.tsx\n```typescript jsx\nimport React, { useEffect } from 'react';\n\nimport {useNylas} from \"@nylas/nylas-react\";\n\nfunction App() {\n  const { authWithRedirect, exchangeCodeFromUrlForToken } = useNylas();\n  const [email, setEmail] = React.useState('');\n\n  useEffect(() =\u003e {\n    const params = new URLSearchParams(window.location.search);\n    if (params.has(\"code\")) {\n      exchangeCodeFromUrlForToken().then((token: string) =\u003e {\n        // do something with the response\n      });\n    }\n  }, [exchangeCodeFromUrlForToken]);\n\n  return (\n    \u003cdiv className=\"App\"\u003e\n      \u003csection style={{width: '80vw', margin: \"10vh auto\"}}\u003e\n        \u003ch1\u003eRead emails sample app\u003c/h1\u003e\n        \u003cp\u003eAuthenticate your email to read\u003c/p\u003e\n        \u003cdiv style={{marginTop: \"30px\"}}\u003e\n          \u003cform\n            onSubmit={(e) =\u003e {\n              e.preventDefault()\n              authWithRedirect({emailAddress: email, successRedirectUrl: \"/success\"})\n            }}\n          \u003e\n            \u003cinput\n              required\n              type=\"email\"\n              placeholder=\"Email Address\"\n              value={email}\n              onChange={(e) =\u003e setEmail(e.target.value)}\n            /\u003e\n            \u003cbutton type=\"submit\"\u003eConnect\u003c/button\u003e\n          \u003c/form\u003e\n        \u003c/div\u003e\n      \u003c/section\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n\n```\n\n## 💙 Contributing\n\nInterested in contributing to the Nylas JavaScript SDK project? Thanks so much for your interest! We are always looking for improvements to the project and contributions from open-source developers are greatly appreciated.\n\nPlease refer to [Contributing](Contributing.md) for information about how to make contributions to this project. We welcome questions, bug reports, and pull requests.\n\n## 📝License\n\nThis project is licensed under the terms of the MIT license. Please refer to [LICENSE](LICENSE.txt) for the full terms. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnylas%2Fnylas-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnylas%2Fnylas-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnylas%2Fnylas-react/lists"}