IzumiSy / elm-firestore / Firestore.Config

A configuration type for Firestore


type Config

Data type for Firestore configuration

This type internally has all information which is required to send requests to Firestore through REST API.

Constructors

new : { apiKey : String, project : String } -> Config

Creates a new Config

withAuthorization : String -> Config -> Config

Specifies Firebase Authorization token which can be obtained through firebase.User#getIdToken method.

withDatabase : String -> Config -> Config

Specifies database ID to connect to.

withHost : String -> Basics.Int -> Config -> Config

Specifies host and port to connect to.

This function is useful when you write integration tests using mock servers such as Firestore Emulator.

Extractors

endpoint : List Url.Builder.QueryParameter -> Appender -> Config -> String

Builds an endpoint string


type Appender
    = Path Firestore.Internals.Path.Path
    | Op String
    | PathOp Firestore.Internals.Path.Path String

Endpoint appender

httpHeader : Config -> List Http.Header

Extracts authorization with bearer prefix as Http.Header.

basePath : Config -> String

Builds a path that can be used in a document name