SDKs
We interact with the backend with the help of SDKs. In this book, we describe the JavaScript SDKs.
client SDKs
The client SDKs run on unprivileged clients, such as browsers. They can also run in Node.js apps that want to run unprivileged.
The client SDKs live in the firebase package:
npm i firebase
admin SDK: privileged environments
The admin SDK is designed to run on secure environments as it relies on privileged service accounts.
The admin SDK authenticates itself against Google servers using a privileged account called a service account. Service accounts are managed by Google, scoped to a Firebase project and have specific entitlements. Such accounts are not subject to security rules and are already authenticated.
As Cloud Functions run on Google servers pre-configured with appropriate service accounts, it is fitting and convenient to use the admin-SDK. The firebase-admin package is designed to run on a Node.js server:
npm i firebase-admin
Cloud Functions SDK
We define Cloud Functions with the (Node.js) Cloud Functions SDK.
We have the package listed as a dependency after scaffolding the Cloud Functions directory with firebase init.
"firebase-functions": "^7.0.0",