Skip to content
Back

Best practices for Appwrite authentication in React Native — External API wrapper safe or direct SDK

  • 0
  • Self Hosted
  • React Native
  • Android
  • Cloud
Ninja coder
9 Aug, 2025, 10:27

Hi Appwrite community,

I’m building a React Native app and planning to use Appwrite for authentication. I have some questions about the architecture and security:

Is it safe to create an external API wrapper (e.g., a Next.js backend route) that calls createEmailPasswordSession using the Appwrite SDK, then returns the access and refresh tokens back to the React Native app?

Since React Native doesn’t have browser-like cookie handling, I would need to manually store tokens securely on the device. Is this approach considered secure?

Will the Appwrite server recognize the user properly if I proxy authentication requests through my backend server, or will it treat all requests as coming from the server itself?

Alternatively, is it better to have the React Native app call the Appwrite SDK directly, and if so, what’s the best way to securely manage tokens in this case?

I want to ensure my authentication flow is secure and follows best practices, especially in the context of React Native apps.

Any practical advice or experiences would be greatly appreciated!

Thanks a lot!

TL;DR
Developers building React Native apps using Appwrite are wondering about the best practices for authentication. They are debating between using an external API wrapper that calls createEmailPasswordSession or having the React Native app call the Appwrite SDK directly. Storing tokens securely on the device is a concern due to React Native's lack of browser-like cookie handling. They seek advice on ensuring a secure authentication flow and are looking for practical advice and experiences from the community. **Solution:** Consider having the React Native app directly call the Appwrite SDK for authentication to ensure a more secure approach. To manage tokens securely in this case, utilize secure storage methods specific to React
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more