Skip to content

Commit

Permalink
Fix code block highlight for javascript apis
Browse files Browse the repository at this point in the history
  • Loading branch information
Tit Petric authored and letzya committed Mar 28, 2024
1 parent db12583 commit dfafc30
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ To work with the key session object, two functions are provided: `TykGetKeyData`

- `TykGetKeyData(api_key, api_id)`: Use this method to retrieve a [session object]({{< ref "getting-started/key-concepts/what-is-a-session-object" >}}) for the key and the API provided:

```jq
```js
// In an event handler, we can get the key idea from the event, and the API ID from the context variable.
var thisSession = JSON.parse(TykGetKeyData(event.EventMetaData.Key, context.APIID))
log("Expires: " + thisSession.expires)
```

- `TykSetKeyData(api_key, api_id)`: Use this method to write data back into the Tyk session store:

```jq
```js
// You can modify the object just like with the REST API
thisSession.expires = thisSession.expires + 1000;

Expand Down

0 comments on commit dfafc30

Please sign in to comment.