firebase-admin.data-connect package

Firebase Data Connect service.

Functions

Function Description
getDataConnect(connectorConfig, app) Gets the DataConnect service with the provided connector configuration for the default app or a given app.getDataConnect(connectorConfig) can be called with no app argument to access the default app's DataConnect service or as getDataConnect(connectorConfig, app) to access the DataConnect service associated with a specific app.

Classes

Class Description
DataConnect The Firebase DataConnect service interface.
FirebaseDataConnectError Firebase Data Connect error code structure. This extends FirebaseError.

Interfaces

Interface Description
ConnectorConfig Interface representing a Data Connect connector configuration.
ExecuteGraphqlResponse Interface representing ExecuteGraphQL response.
ExecuteOperationResponse Interface representing ExecuteOperation response.
GraphqlOptions Interface representing GraphQL options for executing arbitrary GraphQL operations.
ImpersonateAuthenticated Interface representing the impersonation of an authenticated user.
ImpersonateUnauthenticated Interface representing the impersonation of an unauthenticated user.
OperationOptions Interface representing options for executing defined operations.

Variables

Variable Description
DataConnectErrorCode The constant mapping for valid Data Connect client error codes.

Type Aliases

Type Alias Description
AuthClaims Type representing the partial claims of a Firebase Auth token used to evaluate the Data Connect auth policy.
DataConnectErrorCode The type definition for valid Data Connect client error codes.

getDataConnect(connectorConfig, app)

Gets the DataConnect service with the provided connector configuration for the default app or a given app.

getDataConnect(connectorConfig) can be called with no app argument to access the default app's DataConnect service or as getDataConnect(connectorConfig, app) to access the DataConnect service associated with a specific app.

Signature:

export declare function getDataConnect(connectorConfig: ConnectorConfig, app?: App): DataConnect;

Parameters

Parameter Type Description
connectorConfig ConnectorConfig Connector configuration for the DataConnect service.
app App Optional app for which to return the DataConnect service. If not provided, the default DataConnect service is returned.

Returns:

DataConnect

The default DataConnect service with the provided connector configuration if no app is provided, or the DataConnect service associated with the provided app.

Example 1

const connectorConfig: ConnectorConfig = {
 location: 'us-west2',
 serviceId: 'my-service',
 connectorName: 'my-connector',
};

// Get the `DataConnect` service for the default app
const defaultDataConnect = getDataConnect(connectorConfig);

Example 2

// Get the `DataConnect` service for a given app
const otherDataConnect = getDataConnect(connectorConfig, otherApp);

DataConnectErrorCode

The constant mapping for valid Data Connect client error codes.

Signature:

DataConnectErrorCode: {
    readonly ABORTED: "aborted";
    readonly INVALID_ARGUMENT: "invalid-argument";
    readonly INVALID_CREDENTIAL: "invalid-credential";
    readonly INTERNAL: "internal-error";
    readonly PERMISSION_DENIED: "permission-denied";
    readonly UNAUTHENTICATED: "unauthenticated";
    readonly NOT_FOUND: "not-found";
    readonly UNKNOWN: "unknown-error";
    readonly QUERY_ERROR: "query-error";
}

AuthClaims

Type representing the partial claims of a Firebase Auth token used to evaluate the Data Connect auth policy.

Signature:

export type AuthClaims = Partial<DecodedIdToken>;

DataConnectErrorCode

The type definition for valid Data Connect client error codes.

Signature:

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