Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@firebase/app-check

Package Overview
Dependencies
Maintainers
5
Versions
1331
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebase/app-check

The App Check component of the Firebase JS SDK

  • 0.2.0-canary.f4c106e7c
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5M
decreased by-20.52%
Maintainers
5
Weekly downloads
 
Created

What is @firebase/app-check?

The @firebase/app-check npm package is part of the Firebase suite of cloud services designed to protect your Firebase web and mobile backends from abuse, such as billing fraud or phishing. It works by ensuring that only your app's legitimate instances can access your Firebase services.

What are @firebase/app-check's main functionalities?

Initialize App Check with reCAPTCHA

This code initializes Firebase App Check using a reCAPTCHA V3 provider. It helps in defending the Firebase backend by ensuring that interactions are coming from your app's legitimate instances.

import { initializeApp } from 'firebase/app';
import { initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check';

const app = initializeApp({ /* your firebase config */ });
const appCheck = initializeAppCheck(app, {
  provider: new ReCaptchaV3Provider('your-recaptcha-site-key'),
  isTokenAutoRefreshEnabled: true
});

Initialize App Check with Custom Provider

This code snippet demonstrates how to initialize Firebase App Check using a custom token provider. This is useful when you have specific security measures or existing infrastructure that generates tokens for client apps.

import { initializeApp } from 'firebase/app';
import { initializeAppCheck, CustomProvider } from 'firebase/app-check';

const app = initializeApp({ /* your firebase config */ });
const appCheck = initializeAppCheck(app, {
  provider: new CustomProvider({
    getToken: () => {
      // logic to fetch a token from your server
      return fetch('/my-server/get-token').then(response => response.json());
    }
  }),
  isTokenAutoRefreshEnabled: true
});

Other packages similar to @firebase/app-check

FAQs

Package last updated on 02 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc