Module

@adminjs/firebase-functions

Methods

# buildHandler(adminOptions, options) → {BuildHandlerReturn}

Builds the handler which can be passed to firebase functions

usage:

const functions = require('firebase-functions')
const { buildHandler } = require('@adminjs/firebase-functions')

const adminOptions = {...}
const region = '...'

exports.app = functions.https.onRequest(buildHandler(adminOptions, { region }));

Parameters:
Name Type Description
adminOptions AdminJSOptions

options which are used to initialize AdminJS instance

options BuildHandlerOptions

custom options for @adminjs/firebase-functions adapter

View Source adminjs-firebase-functions/src/plugin.ts, line 39

function which can be passed to firebase

BuildHandlerReturn

Type Definitions

object

# BuildHandlerOptions

Properties:
Name Type Attributes Description
region string

Region where function is deployed

before function <optional>

Optional before async hook which can be used to initialize database. , if it returns something it will be used as AdminJSOptions.

auth object <optional>

custom authentication option. If given AdminJS will render login page

secret string

secret which is used to encrypt the session cookie

authenticate function

authenticate function

maxAge number <optional>

For how long cookie session will be stored. , Default to 900000 (15 minutes). , In milliseconds.

customFunctionPath string <optional>

Adjustment path when you proxy the domain. Use case: you proxy your-domain.com/app to admin , firebase function with admin having rootUrl=='/' then you have to tell admin that all paths , he receives are /app namespaced so he can properly resolve them. In such case , customFunctionPath should be set to app because proxy path - rootUrl === 'app'.

View Source adminjs-firebase-functions/src/utils/build-handler-options.ts, line 7