Skip to content

Commit ea74cac

Browse files
update example in README
1 parent 2ec4f46 commit ea74cac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/express-app/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ The examples are compatible with [LTS versions of Node.js](https://github.com/no
3131
The targeting mechanism uses the `exampleTargetingContextAccessor` to extract the targeting context from the request. This function retrieves the userId and groups from the query parameters of the request.
3232

3333
```javascript
34-
const exampleTargetingContextAccessor = () => {
35-
const req = requestAccessor.getStore();
36-
const { userId, groups } = req.query;
37-
return { userId: userId, groups: groups ? groups.split(",") : [] };
34+
const exampleTargetingContextAccessor = {
35+
getTargetingContext: () => {
36+
const req = requestAccessor.getStore();
37+
const { userId, groups } = req.query;
38+
return { userId: userId, groups: groups ? groups.split(",") : [] };
39+
}
3840
};
3941
```
4042

0 commit comments

Comments
 (0)