Skip to content

Commit 757e962

Browse files
committed
Added fcl default configurations section (#1201)
1 parent 53b9f4d commit 757e962

File tree

1 file changed

+16
-0
lines changed
  • docs/tools/clients/fcl-js

1 file changed

+16
-0
lines changed

docs/tools/clients/fcl-js/api.md

+16
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ fcl.config({
3535
});
3636
```
3737

38+
### Using Default Configurations
39+
40+
To simplify setup across networks, FCL provides built-in configuration presets for the most common environments. These include: `flowMainnet`, `flowTestnet` and `flowEmulator`.
41+
42+
Each preset contains the appropriate values for connecting to its corresponding network. To use one, just spread it into your fcl.config() call:
43+
44+
```typescript
45+
import {flowTestnet} from "@onflow/fcl"
46+
47+
fcl.config({
48+
...flowTestnet
49+
})
50+
```
51+
52+
You can view the full preset definitions [here](https://github.com/onflow/fcl-js/blob/master/packages/sdk/src/constants.ts).
53+
3854
### Getting Configuration Values
3955

4056
The `config` instance has an **asynchronous** `get` method. You can also pass it a fallback value.

0 commit comments

Comments
 (0)