惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
V
V2EX
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
Y
Y Combinator Blog
C
Check Point Blog
爱范儿
爱范儿
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
美团技术团队
雷峰网
雷峰网
IT之家
IT之家
WordPress大学
WordPress大学
V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
N
News and Events Feed by Topic
罗磊的独立博客
S
SegmentFault 最新的问题
S
Security Affairs
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
H
Hacker News: Front Page
Google DeepMind News
Google DeepMind News
B
Blog
O
OpenAI News
C
Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
Hacker News: Ask HN
Hacker News: Ask HN
博客园_首页
人人都是产品经理
人人都是产品经理
C
Cybersecurity and Infrastructure Security Agency CISA
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Help Net Security
Help Net Security
月光博客
月光博客
J
Java Code Geeks
L
LangChain Blog
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Apple Machine Learning Research
Apple Machine Learning Research
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Clerk Blog

Going to production with Clerk Deploy Clerk Init: The fastest way to start a new project Introducing Clerk CLI Middleware-based route protection bypass Postmortem: Clerk System Outage (March 10, 2026) Clerk for the AI era Add API Key support to your SaaS in minutes Postmortem: Clerk System Outage (February 19, 2026) Postmortem: DNS Provider Outage (February 10, 2026) How do I implement passkeys in Next.js? Clerk ranked #4 fastest-growing software vendor on Ramp’s December 2025 list How do I handle JWT verification in Next.js? Committing to Agent Identity: Clerk raises $50m Series C from Menlo and Anthropic’s Anthology Fund What is the best way to handle authentication in Next.js App Router? Postmortem: Database Incident (September 14–18, 2025) How do I add authentication to a Next.js app? Introducing Free Trials in Clerk Billing Postmortem: August 28, 2025 - elevated API latency and errors Introducing Mosaic: Bring Your Brand to Every Authentication Flow Multi-tenant authentication: What you need to know (and how Clerk helps) What are the risks and challenges of multi-tenancy? Resilience in Practice: Regional Failover at Clerk Build a Cross-Platform B2B App with Clerk, Expo, and Supabase Highlights from the MiduDev/Clerk Hackathon Add multi-tenancy to an app built with Clerk, Lovable, and Supabase How to build an AI coding rules app with Clerk, Lovable, and Supabase How to Build Multi-Tenant Authentication with Clerk Choosing the right SaaS architecture: Multi-Tenant vs. Single-Tenant Postmortem: June 26, 2025 service outage How to Design a Multi-Tenant SaaS Architecture What is multi-tenancy and why it matters for B2B SaaS How OAuth Works Synchronize user data from Clerk to Supabase Add subscriptions to your SaaS with Clerk Billing Getting started with Clerk Billing Multi-tenant analytics with Tinybird and Clerk How Huntr Migrated 250K Users to Clerk: A Scalable Auth Solution for Startups How to take Clerk to Production How to take your Clerk application to production A practical guide to testing Clerk Next.js applications Implementing multi-tenancy into a Supabase app with Clerk How Clerk integrates with a Next.js application using Supabase How Clerk integrates with Supabase Build a blog with tRPC, Prisma, Next.js and Clerk How to enrich PostHog events with Clerk user data How to build a secure project management platform with Next.js, Clerk, and Neon Validate your SaaS idea while building an audience Postmortem: February 6, 2025 service outage Implement Role-Based Access Control in Next.js 15 Build a Next.js sign-up form with React Hook Form Build a Next.js login page template How to implement Google authentication in Next.js 15 What is middleware in Next.js? How to customize Next.js metadata How to set environment variables in Node.js Building a React Login Page Template How to implement per-user OAuth scopes with Clerk Using Clerk SSO to access Google Calendar and other service data Streamline enterprise customer onboarding with SAML and Clerk Clerk launches EASIE SSO and eliminates SSO fees How to secure Liveblocks Rooms with Clerk in Next.js Securing Node.js Express APIs with Clerk and React Combining the benefits of session tokens and JWTs Build a task manager with Next.js, Supabase, and Clerk Comparing Clerk Webhooks vs Backend API Automate Neon schema changes with Drizzle and GitHub Actions A guide to reading authenticated user data from Clerk Role based access control with Clerk Organizations Mitigating OAuth’s recently discovered Open Response Type vulnerability Per-user B2B monetization with Stripe and Clerk Organizations Build a team-based task manager with Next.js, Neon, and Clerk Building a Hybrid Sign-Up/Subscribe Form with Stripe Elements Welcoming Colin from Zod as our inaugural Open Source Fellow Build a modern authenticated chat application with Next.js, Ably, and Clerk Build a waitlist with Clerk user metadata How to use Clerk with PostHog Identify in Next.js How to secure API Gateway using JWT and Lambda Authorizers with Clerk What are passkeys and how do they work? Comparing Authentication in React.js vs. Next.js How to Add an Onboarding Flow for your Application with Clerk Create Your Own Custom User Menu with Radix - Part 2 Introducing Webhook Workflows with Inngest & Svix Clerk raises $30M Series B from CRV and Stripe Clerk in 2023: A Year in Review Build a Movie Emoji Quiz App with Remix, Fauna, and Clerk Ultimate Guide to Magic Link Authentication Create Your Own Custom User Menu with Radix Introducing has(), protect(), and <Protect> Updated Pricing: 10,000 MAUs Free, and a new “Pro Plan” Next.js Authentication with Clerk: Streamlined SSR Handling Clerk Webhooks: Data Sync with Convex Exploring Clerk Metadata with Stripe Webhooks The Ultimate Guide to Next.js Authentication Empower Your Support Team With User Impersonation Clerk Webhooks: Getting Started A Complete Guide to Session Management in Next.js The Advanced Guide to Passwordless Authentication in Next.js How We Roll – Chapter 10: Roundup How We Roll – Chapter 9: Infrastructure Password-Based Authentication in Next.js
Using Clerk in a React Native app
Nick Parsons · 2026-02-12 · via Clerk Blog

The cross-platform capabilities of React Native combined with Expo's development tools have transformed how developers approach mobile app creation. Add Clerk's user management and Supabase's powerful backend, and you have a complete toolkit for building production-ready apps that deploy everywhere.

In this tutorial, you'll learn how to create a time tracking app called Aika from scratch. You'll create this app with React Native and Expo, implement secure authentication with Clerk, and set up data storage using Supabase. By the end of this guide, you'll have built a fully functional, cross-platform time tracking app that works on both iOS and Android devices.

Why Clerk for authentication?

When building any application, you'll face the challenge of implementing secure authentication. Clerk goes beyond just authentication and provides a complete user management solution that's both secure and easy to implement.

Comprehensive user management

With Clerk, you'll save hours of development time as it handles everything from sign-up and sign-in flows to session management and user profiles. You can easily implement multiple authentication methods including email/password, OAuth providers like Google and Apple, email codes, passkeys, and more.

In this guide, you'll implement email/password and Google authentication, giving your users flexibility in how they access the application.

Multi-tenancy and role-based access control

If you are building an application that requires teams and collaboration, you'll appreciate Clerk's multi-tenancy features and role-based access control. Our B2B tools allow developers to enable users to create their own teams, invite others to join, and assign roles to users within their teams.

Built-in security protections

Clerk has a number of additional security features built into every application created on our platform. These include features like device management and bot detection, which are crucial for maintaining the security of user accounts without requiring you to implement these protections yourself. You can also easily protect against platform abuse by preventing the use of email subaddresses, such as user+tag@example.com, which are often used to bypass free tier limits. Finally, Clerk automatically checks all credentials against a list of known breached credentials to prevent account takeover attacks.

This is not a complete list of the security features we offer, and you can learn more on our Authentication page.

Why choose Supabase for your backend

For data storage, you'll use Supabase, an open-source Firebase alternative that provides a powerful Postgres database with a simple API.

Postgres-based backend as a service

With Supabase, you'll harness the power of a full PostgreSQL database without setting up and maintaining your own server infrastructure. While you can execute SQL queries against the database just like any other, Supabase also provides the Data API, which allows you to access the database from your application using a simple API protected by Row Level Security (RLS), ensuring data is only accessible to the correct users.

Seamless integration with Clerk

One of the most compelling reasons to use Supabase with Clerk is our seamless integration. You'll configure RLS policies to work with Clerk's JWT tokens, requiring users to be authenticated before accessing data belonging to those users. This creates a secure, scalable system with minimal backend code, saving you time and reducing potential security vulnerabilities. Learn more in our Supabase integration guide.

Developer-friendly experience

When working with Supabase, you'll appreciate its clean, intuitive dashboard for managing your database, along with comprehensive documentation. Supabase also has excellent client libraries and developer tooling, making it easy to apply schema changes and deploy changes to your Supabase project from your workstation. This allows you to focus on building features rather than configuring infrastructure.

Build Aika: step-by-step instructions

Now that you understand why we're using Clerk and Supabase, let's build the Aika time tracking app from scratch. Follow these steps carefully to create your own fully functional time tracking application.

Before following along, make sure you have the following:

  • A Clerk account
  • A Supabase account
  • The Supabase CLI installed

A completed version of this project can be found on GitHub.

1. Configure Clerk and Supabase

Start by creating a new Clerk application in the Clerk dashboard. Name your application "Aika" and leave the sign in options as default.

Clerk dashboard

The next page will show the onboarding screen for Clerk, along with a selectable list of the most popular frameworks. Select Expo from the list, copy the API keys from step 2, and set them aside for later use.

Clerk onboarding

Now head over to the Supabase dashboard and create a new project. Name it "Aika", select Generate a password in the Database Password section, and then Create new project. Make sure to copy the password for later use.

Supabase dashboard

Navigate to the Authentication section in the left sidebar, and then select Sign in / Providers, then Third Party Auth. Select Clerk from the list of providers to open a modal to configure the integration.

Configure the Clerk integration in the Supabase dashboard

In the modal, select Clerk's Connect with Supabase page to open the integration wizard in the Clerk dashboard.

Clerk's Connect with Supabase page

In the wizard, ensure the correct organization, application, and instance are selected. Select Activate Supabase integration, then copy the value in the Clerk domain field. This will be used in the next step.

Clerk integration wizard

Once copied, go back to the Supabase dashboard, paste the value into the modal, and select Create connection.

Next, navigate to Project Settings > Data API and note the Project URL for later.

Supabase Data API

Then navigate to the API Keys node and copy the anon key. This will be used in the next step.

Supabase API Keys

Both Clerk and Supabase are now configured, and you can start building Aika.

2. Initialize your React Native app with Expo

Now, you'll create a new Expo project using the latest version of the Expo SDK. Expo provides an excellent development experience for React Native with features like hot reloading, easy access to native APIs, and simplified deployment.

Open your terminal and run these commands:

You should see the Expo development server running and options to open your app on iOS, Android, or web. For this guide, you'll be using the web version of the app, which can be accessed by tapping w in the terminal.

Expo development server

Now stop the development server by pressing Ctrl + C in the terminal and run the following command to install the Clerk and Supabase SDKs along with their peer dependencies:

Create a .env file in your project root to store the Clerk and Supabase API keys:

.env

3. Adding authentication with Clerk

To use the Clerk SDK, you need to wrap the entire application in the ClerkProvider component, which provides access to all of the necessary control components and helper functions. Update app/_layout.tsx to wrap the application in a ClerkProvider:

app/_layout.tsx

Now you'll need to configure the authentication pages as well as a protected area of the application that requires users to be signed in before they can access it. Start by creating a new folder called app/(tabs)/protected and move all of the files from app/(tabs) into it. The updated file structure should look like this:

Create a new layout file at app/(tabs)/_layout.tsx to wrap the protected routes in a Stack.Protected component. The Clerk SDK will be used to determine if the user is signed in and redirect them to the appropriate screen:

app/(tabs)/_layout.tsx

Create the constants/AuthStyles.ts file to export styles that will be shared across the authentication pages, making the code cleaner:

constants/AuthStyles.ts

To support OAuth, you'll use a dedicated OAuthButton component that can accept one of the many providers that Clerk supports. Create components/OAuthButton.tsx:

components/OAuthButton.tsx

Now you'll configure the sign-in and sign-up screens at app/(tabs)/index.tsx and app/(tabs)/sign-up.tsx respectively. This will ensure that the first screen a user sees when they access the application is the sign-in form.

Create app/(tabs)/index.tsx:

app/(tabs)/index.tsx

The sign-up screen is similar to the sign-in screen but contains additional logic to handle verifying a new user account by requesting the six-digit code that is sent to their email address.

Create the app/(tabs)/sign-up.tsx file:

app/(tabs)/sign-up.tsx

Authentication should be fully configured at this point. Start the development server by running the following command in your terminal:

Press w with the terminal focused to open the web version of your app again and test creating an account and signing in. Once signed in, you should be redirected to the protected screen, which is the same as the home screen from before since we moved those screens into the protected folder.

4. Adding Supabase and integrating Clerk

Now that Clerk is configured, you'll need to configure Supabase to work with Clerk. Start by running the following commands in your terminal to initialize Supabase in the repository and link it to the application you created earlier:

Now run the following command to create a new database migration which will be used to store timer history:

A new file will be created at supabase/migrations with a timestamp and the name timer_entries. In the migration file, you'll define the table, enable RLS, and configure the necessary RLS policies to parse the JWT token and extract the Clerk user ID from the sub claim, associating that record to the user who created it.

Open the file and add the following SQL:

supabase/migrations/{TIMESTAMP}-timer_entries.sql

Now run the following command to apply the migration. Paste in the database password from when you created your Supabase project if prompted.

Next you'll configure a custom Supabase client that accepts a Promise<string | null> as an argument, which will be used to set the access token for the Supabase client allowing Clerk to manage the session. Create the utils/supabase.ts file which exports this client:

utils/supabase.ts

Now you can start implementing the core logic for the timer and history.

5. Implementing the timer and history

There are a few components that will be needed to implement this functionality. The below image contains annotated screenshots of the final implementation of the home screen, with the left image showing the timer running and the right image showing it stopped:

The home screen annotated

The timer component is shown when the user has an active timer and lets them stop the timer when they are finished doing the work. Create components/TimerCounter.tsx and paste in the following code:

components/TimerCounter.tsx

The TimerInputForm.tsx component lets the user input a description for the timer and start it. Create components/TimerInputForm.tsx and paste in the following code:

components/TimerInputForm.tsx

The TimeEntryItem.tsx component displays a single time entry and is used in a FlatList component which allows rendering a list of time entries and making it scrollable. This component also has a modal that allows the user to edit or delete the time entry. Create components/TimeEntryItem.tsx and paste in the following code:

components/TimeEntryItem.tsx

All three of these components are then used in app/(tabs)/protected/index.tsx to display the timer, history, and settings. The logic to run operations against Supabase is also implemented in that file and leveraged from the child components.

Update app/(tabs)/protected/index.tsx and replace all of the code with what's below:

app/(tabs)/protected/index.tsx

Now access the application in your browser again and test out the timer functionality! You can also check the database to see the time entries being added:

The Supabase dashboard with entries shown in the table

6. Implementing the settings screen

The last thing you'll build in this demo is a simple settings screen that will display information about the currently logged in user and provide a method of signing out. Two helper functions from the Clerk SDK will be used: the useUser hook to get the currently logged in user and the useAuth hook to access the function required to sign out.

Create the app/(tabs)/protected/settings.tsx file and add the following code:

app/(tabs)/protected/settings.tsx

Expo will automatically add the new screen to the bottom tab bar so you can access it but the icon will not be present since it needs to be set in the layout file for the protected routes. Update app/(tabs)/protected/_layout.tsx to specify the configuration for that bar:

app/(tabs)/protected/_layout.tsx

You'll also need to map the gear icon in the IconSymbol component so it displays in the tab bar:

components/ui/IconSymbol.tsx

Finally, delete the app/(tabs)/protected/explore.tsx screen since it's no longer used.

Conclusion

You've successfully built a fully functional time tracking app using React Native, Expo, Clerk, and Supabase. Through this article, you've learned how to implement secure authentication with Clerk, set up a Supabase database with proper security using Row Level Security that integrates with Clerk, and build a timer interface that allows users to track their time.

The combination of React Native, Expo, Clerk, and Supabase provides a solid foundation for building secure, scalable applications that can grow with your needs. In the next article, we'll explore how to easily add multitenancy with Clerk's B2B tools, making Aika a suitable option for teams and organizations looking to track time for their employees!

Updated February 12, 2026