Skip to content

Commit

Permalink
docs: rewrite project scoping to involve using scoped api tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
daveleek committed Nov 28, 2024
1 parent 64c4cf5 commit ac7e419
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,20 @@ var awesome = unleash.IsEnabled("SuperAwesomeFeature");
The `CreateClientAsync` method was introduced in version 1.5.0, making the previous `Generate` method obsolete. There's also a `CreateClient` method available if you don't prefer the async version.


#### Configuring projects in unleash client
#### Project scoped Unleash client

If you're organizing your feature toggles in `Projects` in Unleash Enterprise, you can specify the `ProjectId` on the `UnleashSettings` to select which project to fetch feature toggles for.
If you're organizing your feature toggles in `Projects` in Unleash Enterprise, you can [scope your API tokens](https://docs.getunleash.io/how-to/how-to-create-project-api-tokens) to just the projects needed for your client. Then use that token when configuring Unleash Client:

```csharp

var settings = new UnleashSettings()
{
AppName = "dotnet-test",
UnleashApi = new Uri("http://unleash.herokuapp.com/api/"),
ProjectId = "projectId"
CustomHttpHeaders = new Dictionary<string, string>()
{
{"Authorization","<your-project-scoped-api-token>" }
}
};

```
Expand Down

0 comments on commit ac7e419

Please sign in to comment.