Skip to content

Commit 3b96362

Browse files
authored
Merge pull request #5 from Alpha018/fix/module
docs: update README to reflect parameter name change from 'global' to 'isGlobal'
2 parents 5acd202 + c0554bd commit 3b96362

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import { UnleashClientModule } from '@alpha018/nestjs-unleash-client';
4949
url: 'http://unleash.herokuapp.com/api/',
5050
appName: 'my-nestjs-app',
5151
},
52-
global: true, // Make the module and its providers global
52+
isGlobal: true, // Make the module and its providers global
5353
}),
5454
// ...
5555
],
@@ -85,12 +85,12 @@ export class AppModule {}
8585

8686
## Parameter Options
8787

88-
Options for `forRoot`:
88+
Options for `forRoot` and `forRootAsync`:
8989

9090
| Parameter | Type | Required | Description |
9191
|-----------|-------------------|----------|--------------------------------------------------------------------------------|
9292
| `config` | `UnleashConfig` | Yes | The configuration object for the `unleash-client`. See options below. |
93-
| `global` | `boolean` | No | If `true`, the module will be registered as a global module. Defaults to `false`. |
93+
| `isGlobal` | `boolean` | No | If `true`, the module will be registered as a global module. Defaults to `false`. |
9494

9595
The `config` object is passed directly to the `unleash-client`. The most common options are:
9696

@@ -101,8 +101,6 @@ The `config` object is passed directly to the `unleash-client`. The most common
101101
| `customHeaders` | `object` | No | Custom headers to be sent to the Unleash API. Use `Authorization` for the API key generated by the Unleash panel. |
102102
| `...` | `any` | No | Any other valid option from the [official unleash-client-node documentation](https://docs.getunleash.io/reference/sdks/node). |
103103

104-
For `forRootAsync`, `isGlobal` is used instead of `global`.
105-
106104
### Protecting a Route with a Feature Toggle
107105
To protect an endpoint with a feature toggle, use the `@UnleashToggle` decorator. The global `UnleashGuard` will automatically deny access if the feature is disabled.
108106

0 commit comments

Comments
 (0)