diff --git a/.changeset/fix-react-readme-connect-imports.md b/.changeset/fix-react-readme-connect-imports.md new file mode 100644 index 0000000..f541c99 --- /dev/null +++ b/.changeset/fix-react-readme-connect-imports.md @@ -0,0 +1,5 @@ +--- +"@nylas/react": patch +--- + +Fix the import path in the README's Connect examples. `useNylasConnect` and `NylasConnectButton` are only exported from the `@nylas/react/connect` subpath, so the snippets that imported them from `@nylas/react` could not resolve. diff --git a/packages/react/README.md b/packages/react/README.md index a91ddd0..777e151 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -31,7 +31,7 @@ or yarn - **Connect** - `useNylasConnect`, `NylasConnectButton` - - Import from `@nylas/react` or `@nylas/react/connect` + - Import from `@nylas/react/connect` ## Getting Started @@ -121,7 +121,7 @@ The `useNylasConnect` hook provides a simple way to add OAuth authentication to ### Basic Usage ```jsx -import { useNylasConnect } from '@nylas/react'; +import { useNylasConnect } from "@nylas/react/connect"; function LoginButton() { const { isConnected, connect, logout, grant, isLoading } = useNylasConnect({ @@ -204,7 +204,7 @@ The `NylasConnectButton` component provides a simple way to add email provider a ### Basic Usage ```jsx -import { NylasConnectButton } from "@nylas/react"; +import { NylasConnectButton } from "@nylas/react/connect"; function App() { return ( @@ -227,7 +227,7 @@ function App() { For applications that use external identity providers (via JWKS), you can pass identity provider tokens during authentication: ```jsx -import { NylasConnectButton } from "@nylas/react"; +import { NylasConnectButton } from "@nylas/react/connect"; function App() { // Function to retrieve JWT token from your external identity provider @@ -258,7 +258,7 @@ function App() { For enhanced security, you can handle the OAuth code exchange on your backend: ```jsx -import { NylasConnectButton } from "@nylas/react"; +import { NylasConnectButton } from "@nylas/react/connect"; function App() { const handleCodeExchange = async (params) => {