firebase和firebase-admin npm模块之间有什么区别?

时间:2021-11-03 20:07:06

I want to build a Node.js web app using Firebase (authentication, database and storage). But I get confused on which module should I use, firebase or firebase-admin (or both).

我想使用Firebase(身份验证,数据库和存储)构建Node.js Web应用程序。但我对应该使用哪个模块,firebase或firebase-admin(或两者)感到困惑。

1 个解决方案

#1


20  

The admin SDK runs your code with administrative permissions. This means it bypasses the security rules of your Firebase Database. It also has functionality to manage users and mint custom tokens and can be used to send FCM messages.

admin SDK使用管理权限运行您的代码。这意味着它绕过了Firebase数据库的安全规则。它还具有管理用户和薄荷自定义令牌的功能,并可用于发送FCM消息。

If you use the regular (non-admin) Firebase module, you're running as a regular Firebase client and don't have these expanded capabilities.

如果您使用常规(非管理员)Firebase模块,则您将作为常规Firebase客户端运行,并且没有这些扩展功能。

#1


20  

The admin SDK runs your code with administrative permissions. This means it bypasses the security rules of your Firebase Database. It also has functionality to manage users and mint custom tokens and can be used to send FCM messages.

admin SDK使用管理权限运行您的代码。这意味着它绕过了Firebase数据库的安全规则。它还具有管理用户和薄荷自定义令牌的功能,并可用于发送FCM消息。

If you use the regular (non-admin) Firebase module, you're running as a regular Firebase client and don't have these expanded capabilities.

如果您使用常规(非管理员)Firebase模块,则您将作为常规Firebase客户端运行,并且没有这些扩展功能。