# Options

You can provide a config when you create your root `NgxsModule`, as `forRoot` accepts 2 arguments. The second argument is a `ModuleOptions` object that can have such properties as `developmentMode`, `compatibility` and `executionStrategy`.

* Turning on `developmentMode` option will add additional debugging features, like freezing your state and actions to guarantee immutability. Default value is `false`.
* `compatibility` is an object that can have `strictContentSecurityPolicy` property, if you set `strictContentSecurityPolicy` to `true`, then the support for the strict Content Security Policy will be enabled. This will cirumvent some optimisations that violate a strict CSP through the use of `new Function(...)`. Default value is `false`.
* `executionStrategy` is an advanced option. It is used to have specific control of the way that ngxs executes code that is considered to be inside the ngxs context (ie. within `@Action` handlers) and the context under which the NGXS behaviours are observed (outside the ngxs context). These observable behaviours are: `@Select(...)`, `store.select(...)`, `actions.subscribe(...)` or `store.dispatch(...).subscribe(...)` &#x20;

  Developers who prefer to manually control the change detection mechanism in their application may choose to use the `NoopNgxsExecutionStrategy` (or implement their own) which does not interfere with zones and therefore relies on the external context to handle change detection (for example: `OnPush` or ivy's rendering engine). The default value of `null` will result in the default strategy being used. The default strategy runs NGXS operations outside Angular's zone but all observable behaviours of NGXS are run back inside Angular's zone. The default value is `null`.

```typescript
@NgModule({
  imports: [
    NgxsModule.forRoot(states, {
      developmentMode: !environment.production,
      compatibility: {
        strictContentSecurityPolicy: true
      },
      executionStrategy: NoopNgxsExecutionStrategy
    })
  ]
})
export class AppModule {}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.ngxs.io/v3.5/advanced/options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
