@quatrain/auth-firebase
v1.2.7
Published
The Firebase Authentication adapter for `@quatrain/auth`.
Readme
@quatrain/auth-firebase
The Firebase Authentication adapter for @quatrain/auth.
Introduction
Firebase Authentication provides backend services to authenticate users. This adapter implements the Quatrain Auth interface using the firebase-admin SDK to verify JWTs and manage users.
Installation
npm install @quatrain/auth-firebase firebase-admin
# or
yarn add @quatrain/auth-firebase firebase-adminConfiguration
Register the adapter using your Firebase service account credentials.
import { Auth } from '@quatrain/auth'
import { FirebaseAuthAdapter } from '@quatrain/auth-firebase'
const firebaseAuth = new FirebaseAuthAdapter({
config: {
projectId: 'your-project-id',
clientEmail: '[email protected]',
privateKey: '-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n'
}
})
Auth.addAdapter('firebase', firebaseAuth, true)Documentation
For concrete examples and usage guides, please refer to the How-To Guide.
License
AGPL-3.0-only
