firebase-admin-proxy
TypeScript icon, indicating that this package has built-in type declarations

4.2.1 • Public • Published

Firebase Admin Node.js SDK

Extends Options

const caw = require("caw");
const https = require("https");
 
// Your Proxy
const firebaseAgent = caw("http://127.0.0.1:8118", {
  protocol: "https",
});
 
admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: "https://YOURAPP.firebaseio.com",
  agent: firebaseAgent, // proxy agent
  logging_enabled: true, // open logging info
});

If logging_enabled is open, your console will print out a similar log:

p:0: Browser went online.
p:0: Listen called for /users default
p:0: Making a connection attempt
p:0: Auth token refreshed
getToken() completed. Creating connection.
c:0:0: Connection created
c:0:0:0 Websocket connecting to wss://YOURAPP.firebaseio.com/.ws?v=5
c:0:0:0 Websocket connected.
c:0:0: Reset packet received.  New host: XXXXX.firebaseio.com
c:0:0: Shutting down all connections
c:0:0:0 WebSocket is being closed
c:0:0:0 Websocket connection was disconnected.
c:0:0:1 Websocket connecting to wss://XXXXX.firebaseio.com/.ws?v=5&ns=YOURAPP
c:0:0:1 Websocket connected.
c:0:0: Realtime connection established.
p:0: connection ready

Find YOURAPP.firebaseio.com and XXXXX.firebaseio.com real ID and add them to the hosts file.

Table of Contents

Overview

Firebase provides the tools and infrastructure you need to develop your app, grow your user base, and earn money. The Firebase Admin Node.js SDK provides admin (second-party) access to several Firebase services.

For more information, visit the Firebase Admin SDK setup guide.

Installation

The Firebase Admin Node.js SDK is available on npm as firebase-admin:

$ npm install --save firebase-admin

To use the module in your application, require it from any JavaScript file:

var admin = require("firebase-admin");

If you are using ES2015, you can import the module instead:

import * as admin from "firebase-admin";

Documentation

Release Notes

Release Notes for the Firebase Admin Node.js SDK are available here.

Acknowledgments

Thanks to the team at Casetext for transferring ownership of the firebase-admin npm module over to the Firebase team and for their longtime use and support of the Firebase platform.

License

The Firebase Admin Node.js SDK is covered by the Terms of Service for Firebase Services.

Package Sidebar

Install

npm i firebase-admin-proxy

Weekly Downloads

2

Version

4.2.1

License

SEE LICENSE IN https://firebase.google.com/terms/

Last publish

Collaborators

  • kezhaofeng