SDKs
We interact with the backend with the help of SDKs.
client SDKs
The client SDKs run on unprivileged clients, such as in browsers. The JavaScript SDK is designed to run on browsers but may also run on Node.js apps that want to act as (unprivileged) clients.
npm i firebase
admin SDK: privileged environments
The admin SDK is designed to perform sensitive operations from secure, privileged environments.
The admin SDK authenticates itself against Google servers by using a privileged account called a service account. Service accounts are automatically created by Google, are scoped to a Firebase project and have specific entitlements. The admin SDK skips user-centric authentication and bypass client-centric security rules.
We notably use the admin SDK within Cloud Functions, which run on Google servers. Google pre-configures the environment with a service account, which the admin SDK detects and uses. As such, we don't have to configure the admin SDK ourselves.
We may use the Node.js admin SDK:
npm i firebase-admin
Note: The admin and client SDK expose similar APIs in some areas.
Cloud Functions SDK
We use a Cloud Functions SDK to define Cloud Functions.
We may use the Node.js Cloud Functions SDK.
When we scaffold the Cloud Functions directory with firebase init, it adds the SDK as a dependency.
"firebase-functions": "^7.0.0",