EndstatePublicClient takes a publishable key (end_pk_...) and is safe to
construct in page source. The key identifies your organization and grants no
access by itself.
What a publishable key can do
Exactly one thing: record a tap.
A publishable key may not send
ttl or dry_run. An untrusted browser does
not get to choose how long its own credential lives.
Allow-list your origin first
The browser blocks the request before it reaches the API unless your page’s origin is on your browser allow-list. The symptom is an opaque network error rather than a useful response, so check this first when a call fails only in the browser. Core sends requests the way the API expects - it never setscredentials - so
once the origin is listed there is nothing further to configure.
Capturing the tap
Core declares the tap-source interface and dispatches to it; it never bundles a reader. Register one andcaptureTap() runs the highest-priority source that
can capture right now.
source a tap reports is an open string, so adding one is not a breaking
change. The well-known names ship as constants - TAP_SOURCE_WEB_NFC,
TAP_SOURCE_READER, TAP_SOURCE_REDIRECT, TAP_SOURCE_MANUAL, and
TAP_SOURCE_UNKNOWN ("web-nfc", "reader", "redirect", "manual",
"unknown").
For real hardware - desktop USB readers and Android phone NFC - use
@endstate-sdk/reader and hand its output straight
to verify():
Reading a tap redirect
On a page you host as a tap redirect destination, the values arrive as query parameters rather than in the path.tryParseTapUrl reads that shape too, on any path:
verify():

