Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

firebase-apparatus

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firebase-apparatus

Lightweight implementation of firebase-tools as a Node module

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

firebase-apparatus

Lightweight implementation of firebase-tools as a Node module.

Install

$ npm i firebase-apparatus

or

$ yarn add firebase-apparatus

Usage

import { Apparatus } from 'firebase-apparatus';

const apparatus = new Apparatus({
    projectId: 'my-firebase-project',
    token: 'my-firebase-ci-token'
});
/*
new Apparatus(
    ApparatusParameters
): Apparatus

type ApparatusParameters = {
    // Firebase project ID
    projectId: string,
    // Firebase CI token with access to projectId
    token: string
};
 */

.authExport()

const users: AuthUser[] = await apparatus.authExport();
/*
apparatus.authExport(
): Promise<AuthUser[]>

type ProviderId =
    | 'google.com'
    | 'facebook.com'
    | 'twitter.com'
    | 'github.com';

type ProviderUserInfo = {
    providerId: ProviderId,
    rawId?: string,
    email?: string,
    displayName?: string,
    photoUrl?: string
};

type AuthUser = {
    localId: string,
    email?: string,
    emailVerified?: boolean,
    displayName?: string,
    photoUrl?: string,
    passwordHash?: string,
    salt?: string,
    createdAt?: string,
    lastSignedInAt?: string,
    phoneNumber?: string,
    providerUserInfo?: ProviderUserInfo[]
};
 */

.authImport()

// Array of <AuthUser> to import
const users: AuthUser[] = [ { ... } ];
// Optional hash options for password import
const hashOptions: HashOptions = { ... };

await apparatus.authImport(users, hashOptions);
/*
apparatus.authImport(
    AuthUser[],
    ?HashOptions
): Promise<void>

type HashOptions = {
    // Hash algorithm used in password for these accounts
    hashAlgo?: string,
    // Key used in hash algorithm
    hashKey?: string,
    // Salt separator which will be appended to salt when verifying password. only used by SCRYPT now
    saltSeparator?: string,
    // Number of rounds for hash calculation
    rounds?: number,
    // Memory cost for firebase scrypt, or cpu/memory cost for standard scrypt
    memCost?: number,
    // Parallelization for standard scrypt
    parallelization?: number,
    // Block size (normally is 8) for standard scrypt
    blockSize?: number,
    // Derived key length for standard scrypt
    dkLen?: number
};
 */

Keywords

FAQs

Package last updated on 23 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc