Navigate

API reference

pyric-admin/app

15 published symbols from pyric-admin

Generated from the TypeScript declarations shipped at this import path.

Interfaces

AdminAppOptions

The app options the sandbox reads: databaseURL selects the app’s RTDB instance, projectId names its default instance, and storageBucket names its default Storage bucket.

Properties

PropertyModifierType
databaseURL?readonlystring
projectId?readonlystring
storageBucket?readonlystring

SandboxAdminApp

Properties

PropertyModifierTypeDescription
[ADMIN_APP_TARGET]readonly"sandbox"-
namereadonlystring-
optionsreadonlyAdminAppOptionsThe options the app was initialized with, as firebase-admin’s App.options keeps them.
sandboxreadonlySandbox-

Type Aliases

InitializeAdminAppConfig

type InitializeAdminAppConfig = {
  sandbox: Sandbox;
} & AdminAppOptions;

Type Declaration

sandbox
sandbox: Sandbox;

PyricAdminApp

type PyricAdminApp = SandboxAdminApp;

PyricAdminAppTarget

type PyricAdminAppTarget = "sandbox";

Variables

ADMIN_APP_TARGET

const ADMIN_APP_TARGET: unique symbol;

Brand carried by every sandbox admin app.


DEFAULT_APP_NAME

const DEFAULT_APP_NAME: "[DEFAULT]" = "[DEFAULT]";

firebase-admin’s default app name.

Functions

applicationDefault()

function applicationDefault(): never;

Firebase Functions’ ESM runtime statically imports this credential factory while linking its database provider. Pyric initializes the sandbox app before that provider executes, so the factory is not used by supported Functions flows. Keep the named export link-compatible, but fail clearly if application code asks the development sandbox for production credentials.

Returns

never


cert()

function cert(serviceAccountPathOrObject: unknown): object;

Link-compatible mirror of firebase-admin/app’s cert(serviceAccountPathOrObject). Returns an inert sandbox credential token so unchanged application setup code can assign appOptions.credential = cert(...) under @pyric/cli/register.

It keeps one field, the service account’s project id, because firebase-admin finds an app’s project there when the options name none. A path is read as a JSON file; a file that is missing, unreadable, or has no project id gives a credential without one, and never throws, so apps run without a key on disk.

Parameters

ParameterType
serviceAccountPathOrObjectunknown

Returns

object


deleteApp()

function deleteApp(app: SandboxAdminApp): Promise<void>;

Remove a sandbox app from the registry.

Parameters

ParameterType
appSandboxAdminApp

Returns

Promise<void>


getApp()

function getApp(name?: string): SandboxAdminApp;

Return the registered app for name.

Parameters

ParameterType
name?string

Returns

SandboxAdminApp


getApps()

function getApps(): SandboxAdminApp[];

Return a copy of the app registry.

Returns

SandboxAdminApp[]


initializeApp()

function initializeApp(config?:
  | Record<string, unknown>
  | InitializeAdminAppConfig, name?: string): SandboxAdminApp;

Initialize a sandbox admin app.

An explicit { sandbox } config binds an in-process or remote sandbox. A bare call resolves the remote sandbox factory installed by @pyric/cli/register. Production callers must import firebase-admin/app without Pyric activation instead of passing production options here.

Parameters

ParameterType
config?| Record<string, unknown> | InitializeAdminAppConfig
name?string

Returns

SandboxAdminApp


isSandboxAdminApp()

function isSandboxAdminApp(app: SandboxAdminApp): app is SandboxAdminApp;

Parameters

ParameterType
appSandboxAdminApp

Returns

app is SandboxAdminApp


refreshToken()

function refreshToken(_refreshTokenPathOrObject: unknown): object;

Link-compatible mirror of firebase-admin/app’s refreshToken(refreshTokenPathOrObject). Returns an inert sandbox credential token, as cert does. Nothing in Pyric reads a refresh token, so the argument isn’t kept.

Parameters

ParameterType
_refreshTokenPathOrObjectunknown

Returns

object