onshore
Developers

Add it in a few lines. Leave it running.

Tokenize at the source with an SDK, or plug in at the log pipeline, the HTTP client and the model endpoint, with no code changes at all.

SDKs

Pick your language.

server.ts
import { VaultClient } from "@onshorehq/sdk";

const vault = new VaultClient({
  baseUrl: "https://vault.gb.onshorevault.com",
  serviceAccountId: process.env.ONSHORE_SA_ID!,
  keyId: process.env.ONSHORE_KEY_ID!,
  privateKey: process.env.ONSHORE_PRIVATE_KEY!,
});

// Store the ID number. Keep the token.
const [{ token }] = await vault.tokenize("v_live_gb01", [
  { field: "national_id", value: "AB123456C", subject_ref: "cust_1042" },
]);

// A policy decides what comes back.
const [reveal] = await vault.detokenize("v_live_gb01", [token!], "Ticket 88213");
console.log(reveal.decision, reveal.value);
Node.js

Token refresh, batching and retries are handled for you. Detokenize fails closed.

Package
@onshorehq/sdk
Output
token  tok_uk_nino_7Hq2xP9LmA4c
reveal masked  *******6789

Packages are shared with early access customers and aren’t on public registries yet. The Android and React Native views still need testing on real devices.

Try detection

See what it finds.

Country
Input
What leaves United Kingdom2 found
Hi, my refund still hasn't arrived. My NI number is tok_uk_nino_5ZkS0nxFT1 and you can call me on tok_phone_ZtBiE3Ut58.
NI number × 1Phone × 1Runs only in this page, with a simplified preview of each country’s pack. Please use made-up data.
What the SDKs handle

Token refresh

SDKs sign in with an Ed25519 service account key and refresh their own access tokens.

Batching and retries

Large calls split into batches of 500, and retryable failures back off and try again.

Fails closed

If the key service can't be reached, nothing is decrypted, and the error says so.

No secrets in apps

Mobile and web views use single-use client tokens that your server mints.

Signed webhooks

Check an event's signature with a helper, including during a secret rotation.

Clear errors

Stable error codes, and a policy denial names the policy that refused.

The API

Clean any text

POST /v1/detect
{ "text": "Refund to GB82 WEST 1234 5698 7654 32 failed. My NI number is AB 12 34 56 C",
  "tokenize": true, "vault": "v_live_gb01" }

200 OK
{ "text": "Refund to tok_iban_Qa81LmZ3Xe0d failed. My NI number is tok_uk_nino_7Hq2xP9LmA4c",
  "entities": [
    { "type": "iban", "start": 10, "end": 37, "score": 0.99 },
    { "type": "uk_nino", "start": 62, "end": 75, "score": 0.97 }
  ] }

Errors you can act on

403
policy_denied
A policy denied the action
422
validation_failed
The value fails its format check
429
rate_limited
A reveal or request limit was reached
503
key_service_unavailable
The key service can't be reached, so nothing is decrypted

Try it with made-up data.

Tell us your stack, and we'll help you run a first test with the SDK you use.