@types/firebase-token-generator

  • Version 2.0.28
  • Published
  • No dependencies
  • MIT license

Install

npm i @types/firebase-token-generator
yarn add @types/firebase-token-generator
pnpm add @types/firebase-token-generator

Overview

TypeScript definitions for firebase-token-generator v2.0.0

Index

Namespaces

namespace firebase-token-generator

module 'firebase-token-generator' {}

    class FirebaseTokenGenerator

    class FirebaseTokenGenerator {}

      constructor

      constructor(secret: string);
      • Builds a new object that can generate Firebase authentication tokens.

        Parameter secret

        The secret for the Firebase being used (get yours from the Firebase Admin Console).

      method createToken

      createToken: (data: any, options?: TokenOptions) => string;
      • Creates a token that authenticates a client with arbitrary data "data", and the specified options.

        Parameter data

        JSON data that will be passed to the Firebase Rules API once a client authenticates. Unless the "admin" flag is set, it must contain a "uid" key, and if it does it must be a string of length 256 or less.

        Parameter options

        The developer-supplied options for this token. Supported options are: a) "expires" -- A timestamp (as a number of seconds since the epoch) denoting a time after which this token should no longer be valid. b) "notBefore" -- A timestamp (as a number of seconds since the epoch) denoting a time before which this token should be rejected by the server. c) "admin" -- Set to true to bypass all security rules (use this for your trusted servers). d) "debug" -- Set to true to enable debug mode (so you can see the results of Rules API operations) e) "simulate" -- (internal-only for now) Set to true to neuter all API operations (listens / puts will run security rules but not actually write or return data) f) "iat" -- (Number) (internal-only, for testing) Set the issued at time for the generated token {String} The authentication token

      Package Files (1)

      Dependencies (0)

      No dependencies.

      Dev Dependencies (0)

      No dev dependencies.

      Peer Dependencies (0)

      No peer dependencies.

      Badge

      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/firebase-token-generator.

      • Markdown
        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/firebase-token-generator)
      • HTML
        <a href="https://www.jsdocs.io/package/@types/firebase-token-generator"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>