Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function initStandalone(app: FirebaseApp, url: string, version: string) {
/**
* This should allow the firebase-admin package to provide a custom version
* to the backend
*/
CONSTANTS.NODE_ADMIN = true;
setSDKVersion(version);
/**
* Create a 'auth-internal' component using firebase-admin-node's implementation
* that implements FirebaseAuthInternal.
* ComponentContainer('database-admin') is just a placeholder that doesn't perform
* any actual function.
*/
const authProvider = new Provider(
'auth-internal',
new ComponentContainer('database-admin')
);
authProvider.setComponent(
new Component(
'auth-internal',
// firebase-admin-node's app.INTERNAL implements FirebaseAuthInternal interface
// eslint-disable-next-line @typescript-eslint/no-explicit-any
() => (app as any).INTERNAL,
ComponentType.PRIVATE
)
);
return {
instance: RepoManager.getInstance().databaseFromApp(app, authProvider, url),
namespace: {