[ Web Proxy ]
URL:
Viewing: https://firebase.google.com/docs/reference/admin/node/firebase-admin.machine-learning [Back]  [Original]

firebase-admin.machine-learning package  |  Firebase Admin SDK Skip to main content
Overview Fundamentals AI Build Run Reference Samples
Firebase [Firebase]
Send feedback

firebase-admin.machine-learning package Stay organized with collections Save and categorize content based on your preferences.

Firebase Machine Learning.

Functions

Function Description
getMachineLearning(app) Gets the MachineLearning service for the default app or a given app.getMachineLearning() can be called with no arguments to access the default app's MachineLearning service or as getMachineLearning(app) to access the MachineLearning service associated with a specific app.

Classes

Class Description
FirebaseMachineLearningError Firebase Machine Learning error code structure. This extends FirebaseError.
MachineLearning The Firebase MachineLearning service interface.
Model A Firebase ML Model output object.

Interfaces

Interface Description
GcsTfliteModelOptions
ListModelsOptions Interface representing options for listing Models.
ListModelsResult Response object for a listModels operation.
ModelOptionsBase Firebase ML Model input objects
TFLiteModel A TensorFlow Lite Model output object

Variables

Variable Description
MachineLearningErrorCode The constant mapping for valid Machine Learning client error codes.

Type Aliases

Type Alias Description
MachineLearningErrorCode The type definition for valid Machine Learning client error codes.
ModelOptions

getMachineLearning(app)

Gets the MachineLearning service for the default app or a given app.

getMachineLearning() can be called with no arguments to access the default app's MachineLearning service or as getMachineLearning(app) to access the MachineLearning service associated with a specific app.

Signature:

export declare function getMachineLearning(app?: App): MachineLearning;

Parameters

Parameter Type Description
app App Optional app whose MachineLearning service to return. If not provided, the default MachineLearning service will be returned.

Returns:

MachineLearning

The default MachineLearning service if no app is provided or the MachineLearning service associated with the provided app.

Example 1

// Get the MachineLearning service for the default app
const defaultMachineLearning = getMachineLearning();

Example 2

// Get the MachineLearning service for a given app
const otherMachineLearning = getMachineLearning(otherApp);

MachineLearningErrorCode

The constant mapping for valid Machine Learning client error codes.

Signature:

MachineLearningErrorCode: {
    readonly ALREADY_EXISTS: "already-exists";
    readonly AUTHENTICATION_ERROR: "authentication-error";
    readonly INTERNAL_ERROR: "internal-error";
    readonly INVALID_ARGUMENT: "invalid-argument";
    readonly INVALID_SERVER_RESPONSE: "invalid-server-response";
    readonly NOT_FOUND: "not-found";
    readonly RESOURCE_EXHAUSTED: "resource-exhausted";
    readonly SERVICE_UNAVAILABLE: "service-unavailable";
    readonly UNKNOWN_ERROR: "unknown-error";
    readonly CANCELLED: "cancelled";
    readonly DEADLINE_EXCEEDED: "deadline-exceeded";
    readonly PERMISSION_DENIED: "permission-denied";
    readonly FAILED_PRECONDITION: "failed-precondition";
    readonly ABORTED: "aborted";
    readonly OUT_OF_RANGE: "out-of-range";
    readonly DATA_LOSS: "data-loss";
    readonly UNAUTHENTICATED: "unauthenticated";
}

MachineLearningErrorCode

The type definition for valid Machine Learning client error codes.

Signature:

export type MachineLearningErrorCode = typeof MachineLearningErrorCode[keyof typeof MachineLearningErrorCode];

ModelOptions

Signature:

export type ModelOptions = ModelOptionsBase | GcsTfliteModelOptions;
Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-06-08 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-08 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page