# FirebaseDataConnect


```
@SubclassOptInRequired
interface FirebaseDataConnect : AutoCloseable
```

<br />

*** ** * ** ***

Firebase Data Connect is Firebase's first relational database solution for app developers to build mobile and web applications using a fully managed PostgreSQL database powered by Cloud SQL.

See <https://firebase.google.com/products/data-connect> for full details about the Firebase Data Connect product.

### GraphQL schema and operation definition

The database schema and operations to query and mutate the data are authored in GraphQL and uploaded to the server. Then, the queries and mutations can be executed by name, providing variables along with the name to control their behavior. For example, a mutation that inserts a row into a "people" table could be named "InsertPerson" and require a variable for the person's name and a variable for the person's age. Similarly, a query to retrieve a row from the "person" table by its ID could be named "GetPersonById" and require a variable for the person's ID.

### Usage with the generated SDK

`https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` is the entry point to the Firebase Data Connect API; however, it is mostly intended to be an implementation detail for the code generated by the Firebase CLI, which provides a type-safe API for running the queries and mutations. The generated classes and functions are colloquially referred to as the "generated SDK" and will encapsulate the API defined in this package. Applications are generally recommended to use the "generated SDK" rather than using this API directly to enjoy the benefits of a type-safe API.

### Obtaining instances

To obtain an instance of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` call `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/package-summary#(com.google.firebase.dataconnect.FirebaseDataConnect.Companion).getInstance(com.google.firebase.FirebaseApp,com.google.firebase.dataconnect.ConnectorConfig,com.google.firebase.dataconnect.DataConnectSettings)`. If desired, when done with it, release the resources of the instance by calling `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#close()`. To connect to the Data Connect Emulator (rather than the production Data Connect service) call `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#useEmulator(kotlin.String,kotlin.Int)`. To create `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef` and `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/MutationRef` instances for running queries and mutations, call `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#query(kotlin.String,kotlin.Any,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy,kotlin.Function1)` and `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#mutation(kotlin.String,kotlin.Any,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy,kotlin.Function1)`, respectively. To enable debug logging, which is especially useful when reporting issues to Google, set `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/package-summary#(com.google.firebase.dataconnect.FirebaseDataConnect.Companion).logLevel()` to `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/LogLevel#DEBUG` .

### Integration with Kotlin coroutines and serialization

The Firebase Data Connect API is designed as a Kotlin-only API, and integrates tightly with [Kotlin Coroutines](https://developer.android.com/kotlin/coroutines) and [Kotlin Serialization](https://github.com/Kotlin/kotlinx.serialization). Applications should ensure that they depend on these two official Kotlin extension libraries and enable the Kotlin serialization Gradle plugin.

All blocking operations are exposed as `suspend` functions, which can be safely called from the main thread. Any blocking and/or CPU-intensive operations are moved off of the calling thread to a background dispatcher.

Data sent to the Data Connect server is serialized and data received from the Data Connect server is deserialized using Kotlin's Serialization framework. Applications will typically enable the official Kotlin Serialization Gradle plugin to automatically generate the serializers and deserializers for classes annotated with `@Serializable`. Of course, applications are free to write the serializers by hand as well.

### Safe for concurrent use

All methods and properties of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` are thread-safe and may be safely called and/or accessed concurrently from multiple threads and/or coroutines.

### Not stable for inheritance

The `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` interface is *not* stable for inheritance in third-party libraries, as new methods might be added to this interface or contracts of the existing methods can be changed.

## Summary

| ### Nested types |
|---|
| `enum https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect.CallerSdkType : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html` A tag used for analytics purposes to track the source of usages of the Firebase Data Connect product. |
| `@https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-subclass-opt-in-required/index.html interface https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect.MutationRefOptionsBuilder<Data : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?, Variables : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?>` Options that can be specified when creating a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/MutationRef` via the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#mutation(kotlin.String,kotlin.Any,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy,kotlin.Function1)` method. |
| `@https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-subclass-opt-in-required/index.html interface https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect.QueryRefOptionsBuilder<Data : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?, Variables : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?>` Options that can be specified when creating a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef` via the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#query(kotlin.String,kotlin.Any,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy,kotlin.Function1)` method. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#close()()` Releases the resources of this object and removes the instance from the instance cache maintained by `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/package-summary#(com.google.firebase.dataconnect.FirebaseDataConnect.Companion).getInstance(com.google.firebase.FirebaseApp,com.google.firebase.dataconnect.ConnectorConfig,com.google.firebase.dataconnect.DataConnectSettings)`. |
| `operator https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#equals(kotlin.Any)(other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?)` Compares this object with another object for equality, using the `===` operator. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#hashCode()()` Calculates and returns the hash code for this object. |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/MutationRef<Data, Variables>` | `<Data : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?, Variables : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?> https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#mutation(kotlin.String,kotlin.Any,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy,kotlin.Function1)( operationName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, variables: Variables, dataDeserializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-deserialization-strategy/index.html<Data>, variablesSerializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-serialization-strategy/index.html<Variables>, optionsBuilder: (https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect.MutationRefOptionsBuilder<Data, Variables>.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)? )` Creates and returns a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/MutationRef` for running the specified mutation. |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef<Data, Variables>` | `<Data : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?, Variables : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?> https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#query(kotlin.String,kotlin.Any,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy,kotlin.Function1)( operationName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, variables: Variables, dataDeserializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-deserialization-strategy/index.html<Data>, variablesSerializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-serialization-strategy/index.html<Variables>, optionsBuilder: (https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect.QueryRefOptionsBuilder<Data, Variables>.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)? )` Creates and returns a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef` for running the specified query. |
| `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#suspendingClose()()` A version of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#close()` that has the same semantics, but suspends until the asynchronous work is complete. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#toString()()` Returns a string representation of this object, useful for debugging. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#useEmulator(kotlin.String,kotlin.Int)(host: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, port: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Configure this `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` object to connect to the Data Connect Emulator. |

| ### Public properties |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/FirebaseApp` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#app()` The `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/FirebaseApp` instance with which this object is associated. |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/ConnectorConfig` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#config()` The configuration of the Data Connect "connector" used to connect to the Data Connect service. |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/DataConnectSettings` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#settings()` The settings of this `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` object, that affect how it behaves. |

## Public functions

### close

```
fun close(): Unit
```

Releases the resources of this object and removes the instance from the instance cache maintained by `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/package-summary#(com.google.firebase.dataconnect.FirebaseDataConnect.Companion).getInstance(com.google.firebase.FirebaseApp,com.google.firebase.dataconnect.ConnectorConfig,com.google.firebase.dataconnect.DataConnectSettings)`.

This method returns immediately, possibly before in-flight queries and mutations are completed. Any future attempts to execute queries or mutations returned from `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#query(kotlin.String,kotlin.Any,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy,kotlin.Function1)` or `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#mutation(kotlin.String,kotlin.Any,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy,kotlin.Function1)` will immediately fail. To wait for the in-flight queries and mutations to complete, call `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#suspendingClose()` instead.

It is safe to call this method multiple times. On subsequent invocations, if the previous closing attempt failed then it will be re-tried.

After this method returns, calling `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/package-summary#(com.google.firebase.dataconnect.FirebaseDataConnect.Companion).getInstance(com.google.firebase.FirebaseApp,com.google.firebase.dataconnect.ConnectorConfig,com.google.firebase.dataconnect.DataConnectSettings)` with the same `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#app()` and `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#config()` will return a new instance, rather than returning this instance.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#suspendingClose()` |   |

### equals

```
operator fun equals(other: Any?): Boolean
```

Compares this object with another object for equality, using the `===` operator.

The implementation of this method simply uses referential equality. That is, two instances of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` compare equal using this method if, and only if, they refer to the same object, as determined by the `===` operator. Notably, this makes it suitable for instances of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` to be used as keys in a `https://developer.android.com/reference/kotlin/java/util/WeakHashMap.html` in order to store supplementary information about the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` instance.

| Parameters |
|---|---|
| `other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?` | The object to compare to this for equality. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `other === this` |

### hashCode

```
fun hashCode(): Int
```

Calculates and returns the hash code for this object.

See `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#equals(kotlin.Any)` for the special guarantees of referential equality that make instances of this class suitable for usage as keys in a hash map.

| Returns |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | the hash code for this object. |

### mutation

```
fun <Data : Any?, Variables : Any?> mutation(
    operationName: String,
    variables: Variables,
    dataDeserializer: DeserializationStrategy<Data>,
    variablesSerializer: SerializationStrategy<Variables>,
    optionsBuilder: (FirebaseDataConnect.MutationRefOptionsBuilder<Data, Variables>.() -> Unit)? = null
): MutationRef<Data, Variables>
```

Creates and returns a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/MutationRef` for running the specified mutation.

| Parameters |
|---|---|
| `operationName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The value for `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/MutationRef#operationName()` of the returned object. |
| `variables: Variables` | The value for `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/MutationRef#variables()` of the returned object. |
| `dataDeserializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-deserialization-strategy/index.html<Data>` | The value for `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/MutationRef#dataDeserializer()` of the returned object. |
| `variablesSerializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-serialization-strategy/index.html<Variables>` | The value for `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/MutationRef#variablesSerializer()` of the returned object. |
| `optionsBuilder: (https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect.MutationRefOptionsBuilder<Data, Variables>.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)? = null` | A method that will be called to provide optional information when creating the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef`; may be `null` (the default) to not perform any customization. |

### query

```
fun <Data : Any?, Variables : Any?> query(
    operationName: String,
    variables: Variables,
    dataDeserializer: DeserializationStrategy<Data>,
    variablesSerializer: SerializationStrategy<Variables>,
    optionsBuilder: (FirebaseDataConnect.QueryRefOptionsBuilder<Data, Variables>.() -> Unit)? = null
): QueryRef<Data, Variables>
```

Creates and returns a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef` for running the specified query.

| Parameters |
|---|---|
| `operationName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The value for `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef#operationName()` of the returned object. |
| `variables: Variables` | The value for `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef#variables()` of the returned object. |
| `dataDeserializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-deserialization-strategy/index.html<Data>` | The value for `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef#dataDeserializer()` of the returned object. |
| `variablesSerializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-serialization-strategy/index.html<Variables>` | The value for `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef#variablesSerializer()` of the returned object. |
| `optionsBuilder: (https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect.QueryRefOptionsBuilder<Data, Variables>.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)? = null` | A method that will be called to provide optional information when creating the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/QueryRef`; may be `null` (the default) to not perform any customization. |

### suspendingClose

```
suspend fun suspendingClose(): Unit
```

A version of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#close()` that has the same semantics, but suspends until the asynchronous work is complete.

If the asynchronous work fails, then the exception from the asynchronous work is rethrown by this method.

Using this method in tests may be useful to ensure that this object is fully shut down after each test case. This is especially true if tests create `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` in rapid succession which could starve resources if they are all active simultaneously. In those cases, it may be a good idea to call `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#suspendingClose()` instead of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#close()` to ensure that each instance is fully shut down before a new one is created. In normal production applications, where instances of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` are created infrequently, calling `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#close()` should be sufficient, and avoids having to create a `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html` just to close the object.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect#close()` |   |

### toString

```
fun toString(): String
```

Returns a string representation of this object, useful for debugging.

The string representation is *not* guaranteed to be stable and may change without notice at any time. Therefore, the only recommended usage of the returned string is debugging and/or logging. Namely, parsing the returned string or storing the returned string in non-volatile storage should generally be avoided in order to be robust in case that the string representation changes.

| Returns |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | a string representation of this object, which includes the class name and the values of all public properties. |

### useEmulator

```
fun useEmulator(host: String = "10.0.2.2", port: Int = 9399): Unit
```

Configure this `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` object to connect to the Data Connect Emulator.

This method is typically called immediately after creation of the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` object and must be called before any queries or mutations are executed. An exception will be thrown if called after a query or mutation has been executed. Calling this method causes the values in `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/DataConnectSettings#host()` and `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/DataConnectSettings#sslEnabled()` to be ignored.

To start the Data Connect emulator from the command line, first [install the Firebase CLI](https://firebase.google.com/docs/emulator-suite/install_and_configure) then run `firebase emulators:start --only auth,dataconnect`. Enabling the "auth" emulator is only needed if using com.google.firebase.auth.FirebaseAuth to authenticate users. You may also need to specify `--project <projectId>` if the Firebase CLI is unable to auto-detect the project ID.

| Parameters |
|---|---|
| `host: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html = "10.0.2.2"` | The host name or IP address of the Data Connect emulator to which to connect. The default value, 10.0.2.2, is a magic IP address that the Android Emulator aliases to the host computer's equivalent of `localhost`. |
| `port: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html = 9399` | The TCP port of the Data Connect emulator to which to connect. The default value is the default port used |

## Public properties

### app

```
val app: FirebaseApp
```

The `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/FirebaseApp` instance with which this object is associated.

The `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/FirebaseApp` object is used for things such as determining the project ID of the Firebase project and the configuration of FirebaseAuth.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/package-summary#(com.google.firebase.dataconnect.FirebaseDataConnect.Companion).getInstance(com.google.firebase.FirebaseApp,com.google.firebase.dataconnect.ConnectorConfig,com.google.firebase.dataconnect.DataConnectSettings)` |   |

### config

```
val config: ConnectorConfig
```

The configuration of the Data Connect "connector" used to connect to the Data Connect service.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/package-summary#(com.google.firebase.dataconnect.FirebaseDataConnect.Companion).getInstance(com.google.firebase.FirebaseApp,com.google.firebase.dataconnect.ConnectorConfig,com.google.firebase.dataconnect.DataConnectSettings)` |   |

### settings

```
val settings: DataConnectSettings
```

The settings of this `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` object, that affect how it behaves.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/package-summary#(com.google.firebase.dataconnect.FirebaseDataConnect.Companion).getInstance(com.google.firebase.FirebaseApp,com.google.firebase.dataconnect.ConnectorConfig,com.google.firebase.dataconnect.DataConnectSettings)` |   |