Evervault browser tokens
Evervault Browser Tokens keep card numbers and passwords out of your automation: your script types a stand-in token, and Evervault's relay swaps in the real value on its way to the site. This guide shows how to upload Evervault's certificate to your Browserless account, make one session trust it, connect over WebSocket, BrowserQL or a saved session, and work within the limits.
- A Browserless API token on a paid cloud plan, from your account dashboard
- An Evervault app with Browser Tokens enabled, plus its app ID and API key
- Node.js 18+ with
puppeteer-coreorplaywright-coreinstalled, or a BrowserQL client jqand curl 7.76 or later, for the certificate upload
How it works
- You upload Evervault's root certificate to your Browserless account once, under a name such as
evervault. - Your server asks Evervault for browser tokens. You send the real values and the hosts allowed to receive them, and you get back a stand-in token per value plus credentials for Evervault's relay.
- You connect to Browserless with the relay as your external proxy and the certificate's name in
caCertificates. - Your script types the stand-in tokens. When the browser sends them to an allowed host, the relay replaces them with the real values.
To replace a value, the relay has to open the browser's TLS connection to the site, which it does with its own certificate authority. A browser rejects that certificate with net::ERR_CERT_AUTHORITY_INVALID, and turning off certificate checks with acceptInsecureCerts would also trust every other invalid certificate. caCertificates gives the session a private certificate store that adds the certificates you name and nothing else. Every other check stays on, and other sessions, even on the same machine, don't trust them.
Sessions that use caCertificates also get two extra protections:
- Browserless checks that the relay's TLS certificate is valid for the proxy hostname you gave before it sends your token credentials there, so a server that only poses as that host is refused. It doesn't check that the hostname belongs to Evervault, so copy it from the token response.
- Browserless never passes the relay credentials to third-party captcha solvers.
Step 1: Upload Evervault's certificate
A session can trust an extra certificate authority only after you upload its certificate to your account. Evervault publishes its root certificate at https://ca.evervault.com. Download it, wrap it in a JSON body with a name, and upload it once.
Each step in this command runs only if the one before it succeeded, and --fail-with-body makes a rejected upload exit with an error while still printing the reason. The files go to a temporary directory that is removed when the subshell exits, so nothing in your working directory is overwritten and the exit status is the upload's:
(
WORK=$(mktemp -d) && trap 'rm -rf "$WORK"' EXIT \
&& curl --fail --silent --show-error https://ca.evervault.com --output "$WORK/evervault-ca.pem" \
&& jq --null-input --rawfile certificate "$WORK/evervault-ca.pem" \
'{certificate: $certificate, name: "evervault"}' > "$WORK/certificate.json" \
&& curl --fail-with-body --silent --show-error --request POST \
--url "https://production-sfo.browserless.io/certificates?token=YOUR_API_TOKEN_HERE" \
--header "Content-Type: application/json" \
--data "@$WORK/certificate.json"
)
Response:
{
"id": "cert_0123456789abcdef01234567",
"name": "evervault",
"certificates": [
{
"subject": "C=IE, ST=Leinster, L=Dublin, O=Evervault, CN=relay.evervault.com, emailAddress=engineering@evervault.com",
"fingerprint": "4137d69968b54bcf27de628e80cbe2535a15604af8b5ed1236831c9285365968",
"expiresAt": "2032-02-16T15:37:46.000Z"
}
],
"expiresAt": "2032-02-16T15:37:46.000Z",
"createdAt": "2026-11-18T12:00:00.000Z",
"updatedAt": "2026-11-18T12:00:00.000Z"
}
Sessions refer to the certificate by its name, and the examples below use evervault. The id works in the same places. A name is unique in your account and case-sensitive. It can have up to 64 characters, can't contain a comma, /, ? or #, can't start or end with a space, and can't start with a dot or with cert_, which is reserved for IDs.
Running the upload again returns 409, because the name is taken. To replace the certificate under the same name, add "replace": true to the JSON body. The certificate keeps its id.
Step 2: Create browser tokens
Create tokens on your server, never in the browser, because the request carries your Evervault API key. The permissions list decides which hosts receive real values. These examples use httpbin.org, which echoes every request back, so you can see the swap.
const EV_APP_ID = "YOUR_EVERVAULT_APP_ID";
const EV_API_KEY = "YOUR_EVERVAULT_API_KEY";
const response = await fetch("https://api.evervault.com/browser-tokens", {
method: "POST",
headers: {
authorization: "Basic " + Buffer.from(`${EV_APP_ID}:${EV_API_KEY}`).toString("base64"),
"content-type": "application/json",
},
body: JSON.stringify({
data: [
{ category: "card.number", value: "4242424242424242", id: "card" },
{ category: "credential.password", value: "S3cret-Pass!42", id: "pw" },
],
permissions: [{ action: "decrypt", target: "httpbin.org" }],
// Evervault caps a token's lifetime at 900 seconds.
ttl: 900,
}),
});
const { data, proxyConfiguration } = await response.json();
const tokens = Object.fromEntries(data.map(({ id, value }) => [id, value]));
const { username, password, hostname, port } = proxyConfiguration;
// Encode the credentials so any URL-reserved character in them can't break the proxy URL.
const relay = `https://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${hostname}:${port}`;
Response (abridged):
{
"data": [
{ "category": "card.number", "value": "<stand-in token>", "id": "card" },
{ "category": "credential.password", "value": "<stand-in token>", "id": "pw" }
],
"proxyConfiguration": {
"hostname": "eu-ie.browser.relay.evervault.app",
"port": 443,
"username": "<relay username>",
"password": "<relay password>"
}
}
The relay password works like an API key until the tokens expire. Keep it out of logs and source control.
Step 3: Connect over WebSocket
Pass the relay as externalProxyServer and the name from Step 1 as caCertificates. URL-encode the relay URL, because it's itself a query parameter value.
- Puppeteer
- Playwright
import puppeteer from "puppeteer-core";
const TOKEN = "YOUR_API_TOKEN_HERE";
// "evervault" is the name the upload in Step 1 used.
const browserWSEndpoint =
`wss://production-sfo.browserless.io?token=${TOKEN}` +
`&externalProxyServer=${encodeURIComponent(relay)}&caCertificates=evervault`;
const browser = await puppeteer.connect({ browserWSEndpoint });
const page = await browser.newPage();
await page.goto("https://httpbin.org/forms/post");
// The page sends stand-ins; the relay swaps them because httpbin.org is allowed.
const echoed = await page.evaluate(async (card, pw) => {
const res = await fetch("https://httpbin.org/anything", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ card, pw }),
});
return (await res.json()).json;
}, tokens.card, tokens.pw);
console.log(echoed);
await browser.close();
import { chromium } from "playwright-core";
const TOKEN = "YOUR_API_TOKEN_HERE";
// "evervault" is the name the upload in Step 1 used.
const pwEndpoint =
`wss://production-sfo.browserless.io/chromium/playwright?token=${TOKEN}` +
`&externalProxyServer=${encodeURIComponent(relay)}&caCertificates=evervault`;
const browser = await chromium.connect(pwEndpoint);
const page = await browser.newPage();
await page.goto("https://httpbin.org/forms/post");
// The page sends stand-ins; the relay swaps them because httpbin.org is allowed.
const echoed = await page.evaluate(async ([card, pw]) => {
const res = await fetch("https://httpbin.org/anything", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ card, pw }),
});
return (await res.json()).json;
}, [tokens.card, tokens.pw]);
console.log(echoed);
await browser.close();
Response:
{ "card": "4242424242424242", "pw": "S3cret-Pass!42" }
The page sent only the stand-ins, and the relay replaced them on the way to httpbin.org. The real values come back because httpbin.org echoes every request, so run this test with sample values, never real ones.
Step 4: Use BrowserQL
Add caCertificates with your certificate's name to the BrowserQL URL and point proxy(server:) at the relay. Pass the relay as a GraphQL variable instead of writing it into the query, so the credentials stay out of the query text.
mutation Swap($relay: String!, $target: String!) {
proxy(url: ["*"], server: $relay) {
time
}
goto(url: $target, waitUntil: load) {
status
}
echo: evaluate(content: "document.body.innerText") {
value
}
}
// TOKEN, relay and tokens come from the earlier steps.
const SWAP_QUERY = `mutation Swap($relay: String!, $target: String!) {
proxy(url: ["*"], server: $relay) { time }
goto(url: $target, waitUntil: load) { status }
echo: evaluate(content: "document.body.innerText") { value }
}`;
const res = await fetch(
`https://production-sfo.browserless.io/chromium/bql?token=${TOKEN}&caCertificates=evervault`,
{
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
query: SWAP_QUERY,
variables: {
relay,
target: `https://httpbin.org/anything?card=${encodeURIComponent(tokens.card)}`,
},
}),
},
);
const { data: result } = await res.json();
console.log(JSON.parse(result.echo.value).args);
Response:
{ "card": "4242424242424242" }
Step 5: Create a session with your Evervault proxy
We recommend this path. Browserless keeps the relay credentials in the encrypted session record, and the connect and browserQL URLs it returns don't contain them, so they never pass through your logs or proxies. Pass the relay's host and port as server, its credentials separately, and your certificate's name in caCertificates:
curl --request POST \
--url "https://production-sfo.browserless.io/session?token=YOUR_API_TOKEN_HERE" \
--header "Content-Type: application/json" \
--data '{
"ttl": 900000,
"proxy": {
"type": "external",
"server": "https://eu-ie.browser.relay.evervault.app:443",
"username": "RELAY_USERNAME",
"password": "RELAY_PASSWORD"
},
"caCertificates": ["evervault"]
}'
Response (abridged):
{
"id": "<session id>",
"connect": "wss://…/session/connect/<session id>?token=<session token>",
"browserQL": "https://…/session/bql/<session id>?token=<session token>",
"stop": "https://…/session/<session id>?token=<session token>",
"ttl": 900000
}
The connect URL is a CDP endpoint. Use it with puppeteer.connect({ browserWSEndpoint }) or Playwright's chromium.connectOverCDP(), and send BrowserQL queries to browserQL. Leave out externalProxyServer, caCertificates and proxy(server:), because Browserless applies the stored relay and certificates every time you connect or reconnect. A ttl of 15 minutes matches the longest token lifetime.
Set caCertificates when you create the session. Adding it to the returned URLs later returns 400 with "caCertificates" must be set when the session is created with POST /session.
The session stores the names and IDs as you sent them, and Browserless looks the certificates up every time the session's browser starts. When you replace a certificate under its name, a saved session that uses the name trusts the new certificate the next time its browser starts. You don't create a new session.
Manage your certificates
The same API lists, replaces and deletes what you uploaded. It also works for another relay or proxy that signs sites with its own certificate authority. If that proxy's own https:// address uses a certificate from the same private authority, the session accepts it too: Browserless checks the proxy's certificate against public certificate authorities and the certificates the session names.
| Request | What it does |
|---|---|
POST /certificates | Uploads a PEM with up to 10 CA certificates, 64 KB at most, under a name. A name that is taken returns 409. With "replace": true the upload replaces the certificate of that name, which keeps its ID. |
GET /certificates | Lists your certificates, newest first. |
GET /certificates/<name or id> | Returns one certificate's details. No request returns the PEM. |
DELETE /certificates/<name or id> | Deletes it. A browser that is already running keeps it until it closes. After that, every session that names it returns 400, including a saved session created with it. |
Limits and rules:
- Uploading needs a paid plan. Listing, reading and deleting work on every plan.
- An account holds up to 20 certificates, and a session takes up to five names or IDs.
- Each upload must hold CA certificates that haven't expired, and must not contain a private key.
- A session that names a certificate needs an external proxy, and it trusts the certificate for that session only.
- URL-encode a name in a path or a query string when it has spaces or other reserved characters.
FAQ & Troubleshooting
Why does every page fail with net::ERR_TUNNEL_CONNECTION_FAILED after a few minutes?
The tokens expired. Evervault tokens and relay credentials last at most 15 minutes, and after they expire the relay rejects every request in the session, including hosts it doesn't swap. Create fresh tokens and a new session for each run. Browserless writes Evervault proxy credentials expired, revoked or invalid (407) to the session log once when this happens.
Why do I get net::ERR_CERT_AUTHORITY_INVALID?
The session doesn't trust Evervault's certificate authority. Upload Evervault's certificate, then pass its name as caCertificates on the connection URL, or in the caCertificates array when you create a session.
The relay can answer with its own certificate for any HTTPS site in the session, not only the hosts in permissions, so every session that uses the relay needs caCertificates.
What happens when Evervault rotates its certificates?
Usually nothing. You uploaded Evervault's root certificate, the one published at https://ca.evervault.com, so the certificates the relay issues under it can change at any time. If Evervault replaces the root itself, relay pages fail with net::ERR_CERT_AUTHORITY_INVALID until the session trusts the new one. Upload the new root under the same name with "replace": true. Every session that uses the name, saved sessions included, trusts the new root the next time its browser starts, so no connection URL or session changes. A browser that is already running keeps the old root until it closes. To trust both roots during the changeover, upload one PEM that holds the old and the new certificate. A session never falls back to skipping certificate checks.
Why do I get CA certificate "…" was not found?
No certificate with that name or ID belongs to the account your API token is in, or it was deleted. Names are case-sensitive, so Evervault doesn't match evervault. List the ones you have with GET /certificates, and upload it again if it's missing. A saved session that names a deleted certificate works again once you upload a certificate under that name.
A value that can't be a name or an ID, such as cert_123, returns 400 with Unknown CA certificate "<value>". Use the name or the ID of a certificate uploaded with POST /certificates.
Why do I get "caCertificates" requires an external proxy?
caCertificates only makes sense with a relay in the path, so Browserless refuses it without one. Pass externalProxyServer, a BrowserQL proxy(server:) call or a session created with "proxy": { "type": "external" }.
Why do I get Uploading CA certificates requires a paid cloud-unit plan?
Uploading a certificate needs a paid Browserless cloud plan, the same as the external proxy a session uses it with. On the free plan POST /certificates returns 401. You can still list and delete certificates you uploaded earlier, so nothing is left behind after a downgrade.
Which values can Evervault swap?
Evervault Browser Tokens cover three categories: card.number, card.cvv and credential.password. The relay swaps a token only in requests to the hosts in permissions. Pages that encrypt a value in the browser before sending it can't be swapped, because the relay only sees the encrypted form.
Can a recording or screenshot capture the real values?
Yes, if the site sends them back. Your script types only stand-ins, and Evervault swaps only what the browser sends. Anything the site returns reaches the browser unchanged, so a confirmation page that shows the card number puts the real value in the page, its screenshots and the session recording. Leave replay off for these sessions if that matters to you.
Why does the site see a different IP address or location?
Traffic leaves through Evervault's relay, so sites see Evervault's IP address and TLS fingerprint rather than Browserless's. Set the timezone and locale explicitly to match, for example with Playwright's timezoneId and locale context options or Puppeteer's page.emulateTimezone(). See launch parameters for session-level settings.
Can I use Browserless residential proxies in the same session?
No. A session has one upstream proxy, and the relay takes that place. If the connection URL has both proxy=residential and externalProxyServer, Browserless uses the relay and skips the residential proxy. For a residential IP address, ask Evervault to enable residential egress for your app and request it when you create the tokens. Sessions without the relay keep using Browserless proxies as before.
Why does captcha solving report that a proxy is required?
Sessions with caCertificates or an Evervault relay never pass proxy credentials to third-party captcha solvers. Solvers that need the session's own IP address report that they need a proxy instead. Solvers that don't use a proxy keep working.
Which browsers support caCertificates?
Chromium-based browsers: Chromium, Chrome, Edge and Brave. It works over CDP, stealth, BrowserQL, REST calls such as /content, and Playwright with a Chromium-based browser. Firefox and WebKit return 400 with "caCertificates" is only supported by Chromium-based browsers.
Can I use this with self-hosted Browserless?
No. caCertificates works on Browserless cloud only: self-hosted builds ignore it on connection URLs and reject it, along with external proxies, on POST /session with 400. On self-hosted, build an image that replaces /home/blessuser/.pki/nssdb with a copy that also trusts Evervault's root, and set NODE_EXTRA_CA_CERTS to Evervault's certificate. That makes every session on the image trust Evervault, so run it only for workloads that need the relay.