New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adminjs/firebase

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adminjs/firebase

Firebase adapter for AdminJS

  • 2.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

AdminJS Firebase Adapter

Adapter for AdminJS which allows to add your own Firebase resources

Prerequisites

You will need AdminJS panel configured for your project. See AdminJS Repository for instructions

You have to initialize your Firebase app before connecting resources to AdminJS. That means you have to write something like:

// Your firebase config see https://firebase.google.com/docs/web/setup
export const firebaseConfig = {
  // [...]
};

Firebase.initializeApp(firebaseConfig);

Installing

To connect adapter to your AdminJS instance all you need is to:

  1. Register this adapter into AdminJS instance
  2. Write resource with schema
  3. Pass resource to AdminJS config object

Check example folder for full example application!

import * as firebase from "firebase";
import AdminJSExpress from '@adminjs/express';
import AdminJSFirebase from '@adminjs/firebase';
import AdminJS from 'adminjs'; 

const setupAdmin = async expressApp => {
  AdminJS.registerAdapter(AdminJSFirebase);
  const adminJs = new AdminJS({
    branding: {
      companyName: 'Firebase example',
    },
    resources: [
      {
        collection: firebase.firestore().collection('Users'),
        schema: {
          name: 'string',
          isAdmin: 'boolean',
          location: 'mixed',
          attributes: {
            type: 'mixed',
            schema: {
              birthdate: 'date',
              height: 'number',
              eyeColors: 'mixed',
            },
          },
        },
      },
    ],
  });

  const router = await AdminJSExpress.buildRouter(adminJs);
  app.use(adminJs.options.rootPath, router);
};

Authors

Known Issues

Described in Issues tab.

Feel free to contribute.

License

This project is licensed under the MIT License

FAQs

Package last updated on 13 Jul 2022

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