Firebase

How to enable and configure Firebase App Check for improved security?

Discover how to set up Firebase App Check for stronger security, protecting your app from abuse and ensuring only real users access your Firebase services.

Developer profile skeleton
a developer thinking

Overview

Firebase App Check boosts the security of your Firebase app by making sure only your app taps into backend resources. To get started, set up your app's credentials, bring in the App Check SDK, and tweak your backend to verify the App Check tokens. You'll choose an attestation provider such as reCAPTCHA, SafetyNet, or DeviceCheck. After that, add the required dependencies, get App Check up and running in your client app, then update Firebase services to enforce the App Check verification.

Get a Free No-Code Consultation
Meet with Will, CEO at Bootstrapped to get a Free No-Code Consultation
Book a Call
Will Hawkins
CEO at Bootstrapped

How to enable and configure Firebase App Check for improved security?

Step 1: Open Firebase Console

Head over to the Firebase Console Firebase Console.

Step 2: Select Your Project

In the Firebase Console, pick the project you want to enable App Check for.

Step 3: Navigate to App Check

On the left sidebar, find and click the "App Check" tab under the “Build” section.

Step 4: Register Your App for App Check

Click “Get Started” if you see it. Then, select the app you want to protect from the list (e.g., Android, iOS, Web).

Step 5: Choose Your App Check Provider

Pick the App Check provider. For example:

  • Android: Play Integrity or SafetyNet
  • iOS: DeviceCheck or App Attest
  • Web: reCAPTCHA v3

Step 6: Configure App Check

Follow the instructions based on your provider:

  • For Android using Play Integrity: Add the SHA-256 fingerprint of your Android app and make sure Play Integrity API is enabled in Google Cloud Console.
  • For iOS using DeviceCheck or App Attest: Follow the on-screen steps to register your app with the chosen provider.
  • For Web using reCAPTCHA v3: Generate site keys and set up reCAPTCHA in your HTML.

Step 7: Integrate App Check SDK

Add the App Check SDK to your app’s code. Here’s an example for a web app:

// Import the App Check package
import { initializeAppCheck, ReCaptchaV3Provider } from "firebase/app-check";

// Initialize App Check
const appCheck = initializeAppCheck(firebaseApp, {
  provider: new ReCaptchaV3Provider('YOUR_RECAPTCHA_KEY'),
  isTokenAutoRefreshEnabled: true // Optionally enable automatic token refresh
});

Don’t forget to replace ‘YOUR_RECAPTCHA_KEY’ with your actual key.

Step 8: Enable App Check Enforcement

Go back to the Firebase Console and return to the App Check configuration page. Turn on enforcement mode for each service you want to protect, like Firestore, Realtime Database, or Cloud Functions.

Step 9: Test and Deploy

Test your app to make sure it works fine with App Check enabled. If everything looks good, go ahead and deploy your app.

Step 10: Monitor App Check

After deploying, use the Firebase Console to keep an eye on App Check metrics. Make sure your app isn’t getting too many rejections, which could mean there’s an issue with real users.

Explore more Firebase tutorials

Complete Guide to Firebase: Tutorials, Tips, and Best Practices

Explore our Firebase tutorials directory - an essential resource for learning how to create, deploy and manage robust server-side applications with ease and efficiency.

Why are companies choosing Bootstrapped?

40-60%

Faster with no-code

Nocode tools allow us to develop and deploy your new application 40-60% faster than regular app development methods.

90 days

From idea to MVP

Save time, money, and energy with an optimized hiring process. Access a pool of experts who are sourced, vetted, and matched to meet your precise requirements.

1 283 apps

built by our developers

With the Bootstrapped platform, managing projects and developers has never been easier.

hero graphic

Our capabilities

Bootstrapped offers a comprehensive suite of capabilities tailored for startups. Our expertise spans web and mobile app development, utilizing the latest technologies to ensure high performance and scalability. The team excels in creating intuitive user interfaces and seamless user experiences. We employ agile methodologies for flexible and efficient project management, ensuring timely delivery and adaptability to changing requirements. Additionally, Bootstrapped provides continuous support and maintenance, helping startups grow and evolve their digital products. Our services are designed to be affordable and high-quality, making them an ideal partner for new ventures.

Engineered for you

1

Fast Development: Bootstrapped specializes in helping startup founders build web and mobile apps quickly, ensuring a fast go-to-market strategy.

2

Tailored Solutions: The company offers customized app development, adapting to specific business needs and goals, which ensures your app stands out in the competitive market.

3

Expert Team: With a team of experienced developers and designers, Bootstrapped ensures high-quality, reliable, and scalable app solutions.

4

Affordable Pricing: Ideal for startups, Bootstrapped offers cost-effective development services without compromising on quality.

5

Supportive Partnership: Beyond development, Bootstrapped provides ongoing support and consultation, fostering long-term success for your startup.

6

Agile Methodology: Utilizing agile development practices, Bootstrapped ensures flexibility, iterative progress, and swift adaptation to changes, enhancing project success.

Yes, if you can dream it, we can build it.