Skip to content

Commit

Permalink
docs(functions): highlight region-specific usage of useEmulator (#7811)
Browse files Browse the repository at this point in the history
  • Loading branch information
subramanian-elavathur authored Jun 6, 2024
1 parent b2d7bc3 commit 3ef361e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/functions/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,20 @@ To learn more about deploying Functions to Firebase, view the [Writing & Deployi

Whilst developing your application with Cloud Functions, it is possible to run the functions inside of a local emulator.

To call the emulated functions, call the `useEmulator` method exposed by the library:
To call the emulated functions in the **default** region, call the `useEmulator` method exposed by the library:

```js
import functions from '@react-native-firebase/functions';

// Use a local emulator in development
if (__DEV__) {
// If you are running on a physical device, replace http://localhost with the local ip of your PC. (http://192.168.x.x)
firebase.functions().useEmulator('localhost', 5001);
functions().useEmulator('localhost', 5001);
}
```

If your functions are deployed on a different region, then please see [Region-specific Functions](#region-specific-functions)

## Calling an endpoint

Assuming we have a deployed a callable endpoint named `listProducts`, to call the endpoint the library exposes a
Expand Down

0 comments on commit 3ef361e

Please sign in to comment.