Skip to Content
Onshore is in early access. Don’t load real customer data until the items in Known limits are closed.
DevelopersSDKsOverview

SDKs

There are two kinds of SDK, and they never mix.

  • Server SDKs hold a service account’s private key. They store and reveal values, search people, run checks and mint client tokens. They run on your servers only.
  • Client SDKs run in browsers and apps and hold no credentials. They collect or show values inside a component the vault controls, using a single-use client token your server mints, so your front end never touches the value.

Server SDKs

Every server SDK covers the whole data API and behaves the same way.

Node.jsPythonGoJavaPHP
Package@onshorehq/sdkonshoregithub.com/Onshore-HQ/onshore-gocom.onshorevault:onshore-sdkonshorehq/sdk
Sourceonshore-node onshore-python onshore-go onshore-java onshore-php 
RuntimeNode 20+Python 3.9+Go 1.22+Java 17+PHP 8.1+
Dependenciesnonecryptographynonenonesodium, curl (built in)
Styleasyncblockingcontext.Contextblockingblocking
ReferenceNode.jsPythonGoJavaPHP

Methods in every server SDK

Names follow each language’s style: insertRecord in Node, Java and PHP, insert_record in Python, InsertRecord in Go.

TaskMethodAPI
Store values, get tokens (with continue_on_error, dry_run)tokenizePOST /v1/vaults/{vault}/tokenize
Reveal values as rules allow (with per-item redaction)detokenizePOST …/detokenize
Store several fields for one personinsertRecordPOST …/records
Read a recordgetRecordGET …/records/{id}
Change the value behind a cell tokenupdateValuePUT …/tokens/{token}
Find a token by valuelookupPOST …/lookup
List and filter peoplesearchSubjectsPOST …/subjects/search
One person, maskedgetSubjectGET …/subjects/{id}
Export a person’s dataexportSubjectGET …/subjects/{id}/export
Restrict a personrestrictSubjectPOST …/subjects/{id}/restrict
Erase a personeraseSubjectDELETE …/subjects/{id}
Yes-or-no check in the countryresidentCheckPOST …/resident/check
Find identifiers in textdetectPOST /v1/detect
Report a batch before it leavescheckFlowPOST …/flows/{flow}/check
Token for a secure componentcreateClientTokenPOST …/client-tokens
Cloak text for AI, and restore itcloak, uncloak, deleteTwinPOST …/cloak, POST …/uncloak, DELETE …/twins/{id}
Check a webhook signatureverifyWebhook(local)

Shared behaviour

AuthenticationSigns a two-minute Ed25519 assertion and exchanges it for a 15-minute bearer token, refreshed a minute before expiry. You never handle tokens. See Authentication
Batchingtokenize and detokenize accept any number of items and send 500 per request. Each result’s index is its position in your input
RetriesNetwork failures, timeouts, 429 and 5xx are retried with growing, jittered waits, 4 attempts by default. Other errors are returned at once
401Clears the cached token and fails. The next call signs a fresh assertion
Failing closedA reveal never returns a token as if it were the value. If the vault can’t answer, the call fails
ErrorsOne error type per SDK with status, code, message, policy and request ID. Messages never contain a stored value. Codes are listed in Retries and errors
Timeouts10 seconds per attempt by default

Client SDKs

WebiOSAndroidReact Native
Packagerv.js, served by your vaultSwift package Onshoreng.onshore.sdk@onshorehq/react-native
SourcePart of the vaultonshore-ios onshore-android onshore-react-native 
CollectOnshore.collectCollectFormCollectView<CollectForm>
RevealOnshore.revealRevealViewRevealView<RevealView>
Value isolationSeparate origin: your page can’t read itIn your app’s processIn your app’s processShared JS context
ScreenshotsBrowser’s choiceCan’t be blocked on iOSBlocked (FLAG_SECURE)Not blocked
ReferenceWebiOSAndroidReact Native

The end-to-end flow (server mints, client collects, server stores the token) is in Collect and reveal in the front end.

All SDKs are open source under Apache-2.0, so you can ship them inside your own apps, closed source or not.

Early access. The Node.js and React Native SDKs are on npm (@onshorehq/sdk, @onshorehq/react-native). Go and iOS install straight from GitHub. Python, Java, PHP and Android aren’t on their registries (PyPI, Maven Central, Packagist) yet; each page shows how to install from its GitHub repository until they are. The mobile SDKs haven’t run on a physical device yet.

Something not covered?

Every endpoint is in the API reference, with a client to try it. Calling the API directly means signing assertions yourself; Authentication shows how in any language.

Last updated on