Skip to content

Commit

Permalink
chore: document only single OpenFgaClient should be created
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyjames committed Feb 27, 2024
1 parent 6e57d3d commit dd65b49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ libraryDependencies += "dev.openfga" % "openfga-sdk" % "0.3.2"

[Learn how to initialize your SDK](https://openfga.dev/docs/getting-started/setup-sdk-client)

We strongly recommend you initialize the `OpenFgaClient` only once and then re-use it throughout your app, otherwise you will incur the cost of having to re-initialize multiple times or at every request, the cost of reduced connection pooling and re-use, and would be particularly costly in the client credentials flow, as that flow will be preformed on every request.

> The `Client` will by default retry API requests up to 15 times on 429 and 5xx errors.
#### No Credentials

```java
Expand Down

0 comments on commit dd65b49

Please sign in to comment.