Description
Firebase Node for n8n
This node allows you to interact with Firebase Admin SDK in n8n to perform various operations with Firebase Authentication.
Features
Authentication Operations
- Verify ID Token – Verify Firebase ID token
- Get User by UID – Get user information by UID
- List All Users – List all users in Firebase Auth
- Create User – Create a new user
- Update User – Update user information
- Delete User – Delete a user
Installation
- Make sure you have Node.js version 20.15 or higher installed
- Install dependencies:
npm install - Build the project:
npm run build
Setting up credentials
Method 1: Service Account JSON (Recommended)
- Go to Firebase Console
- Select your project
- Go to Project Settings > Service Accounts
- Click "Generate New Private Key"
- Download the JSON file
- In n8n, paste the contents of the JSON file in the "Service Account JSON" field
Method 2: Individual fields
- Project ID – Your Firebase project ID
- Private Key – Private key from the service account
- Client Email – Client email from the service account
Usage
Verify ID Token
Verifies a Firebase ID token and returns user information.
Parameters:
ID Token– Firebase ID token to verify
Returns:
- User information (uid, email, displayName, etc.)
Get User by UID
Gets user information by their UID.
Parameters:
User UID– User UID
Returns:
- Complete user information
List All Users
Gets a list of all users in Firebase Auth.
Parameters:
Max Results– Maximum number of users to return (max 1000)Next Page Token– Token for pagination (optional)
Returns:
- List of users with pagination information
Create User
Creates a new user in Firebase Auth.
Parameters:
Email– User's email addressPassword– User's passwordDisplay Name– Display namePhone Number– Phone numberEmail Verified– Whether the email is verifiedDisabled– Whether the account is disabled
Returns:
- Information about the created user
Update User
Updates information about an existing user.
Parameters:
User UID– UID of the user to updateEmail– New email addressDisplay Name– New display namePhone Number– New phone numberEmail Verified– Email verification statusDisabled– Account status
Returns:
- Updated user information
Delete User
Deletes a user from Firebase Auth.
Parameters:
User UID– UID of the user to delete
Returns:
- Success message
Usage examples
Verify user token
{
"resource": "auth",
"operation": "verifyIdToken",
"idToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Get list of users
{
"resource": "auth",
"operation": "listUsers",
"maxResults": 100
}
Create new user
{
"resource": "auth",
"operation": "createUser",
"email": "user@example.com",
"password": "securepassword123",
"displayName": "John Doe",
"emailVerified": false,
"disabled": false
}
Security
- Firebase credentials are stored in encrypted form
- Use service account with minimal required permissions
- Do not share private keys in plain text
Support
If you encounter problems:
- Check the correctness of Firebase credentials
- Make sure the service account has permissions for Firebase Auth
- Check n8n logs for additional error information
License
MIT License