UNPKG

1.44 kBTypeScriptView Raw
1/*! firebase-admin v13.0.2 */
2/*!
3 * @license
4 * Copyright 2021 Google Inc.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18export interface ServiceAccount {
19 projectId?: string;
20 clientEmail?: string;
21 privateKey?: string;
22}
23/**
24 * Interface for Google OAuth 2.0 access tokens.
25 */
26export interface GoogleOAuthAccessToken {
27 access_token: string;
28 expires_in: number;
29}
30/**
31 * Interface that provides Google OAuth2 access tokens used to authenticate
32 * with Firebase services.
33 *
34 * In most cases, you will not need to implement this yourself and can instead
35 * use the default implementations provided by the `firebase-admin/app` module.
36 */
37export interface Credential {
38 /**
39 * Returns a Google OAuth2 access token object used to authenticate with
40 * Firebase services.
41 *
42 * @returns A Google OAuth2 access token object.
43 */
44 getAccessToken(): Promise<GoogleOAuthAccessToken>;
45}