# 📢 Release Update: Web API: Custom authentication flows with pre-request scripts

**URL:** <https://community.squaredup.com/t/release-update-web-api-custom-authentication-flows-with-pre-request-scripts/2560>\
**Category:** SquaredUp Cloud\
**Tags:** changelog\
**Created:** [August 12, 2026, 7:27am UTC](https://community.squaredup.com/t/release-update-web-api-custom-authentication-flows-with-pre-request-scripts/2560 "2026-08-12T07:27:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![support1](https://community.squaredup.com/user_avatar/community.squaredup.com/support1/32/1346_2.png) [@support1](https://community.squaredup.com/u/support1)\
**Post date:** [August 12, 2026, 7:27am UTC](https://community.squaredup.com/t/release-update-web-api-custom-authentication-flows-with-pre-request-scripts/2560/1 "2026-08-12T07:27:44Z")

</div>

The Web API data source can now run a JavaScript pre-request script before every data stream request, so you can connect to APIs with authentication flows that don't fit standard Basic, Digest, OAuth 2.0 or JWT Bearer options.

**Enable scripting on the data source**

Turn on "Pre-request script" in the Web API data source configuration to show the Secrets and script fields. The script runs once before each request, so a single configuration covers every data stream that uses the data source.

**Store credentials securely**

Define key-value pairs under Secrets and access them in your script via the secrets object. Click the padlock next to a value to encrypt it when stored — recommended for API keys, client secrets and authentication tokens.

**Handle token exchange and signed requests**

Your script can read and modify the request url, headers and body before it's sent. A writable state object lets you cache values such as access tokens between requests, stored encrypted, so you can fetch a token once and refresh it only when it expires. That makes it possible to support flows like exchanging a signed token for a short-lived access token, or calculating a request signature per call.

[Learn more](https://docs.squaredup.com/data-sources/web-api-plugin#configuring-the-data-source)

 ![image](https://community-cdn.squaredup.com/original/2X/4/4ff4355efa847f6e482bad8446650305f489b2aa.png)

> View all release updates: [Changelog | SquaredUp](https://feedback.squaredup.com/changelog)
