> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endstate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# createEndstateClient

> Build an EndstatePublicClient pre-wired with the browser tap sources, so a web integration never constructs the core client class directly.

```ts theme={null}
function createEndstateClient(
  options: CreateEndstateClientOptions,
): EndstatePublicClient;

interface CreateEndstateClientOptions
  extends Omit<ClientConfigBase, "tapSources"> {
  publishableKey:
    | EndstatePublishableKey
    | (() => EndstatePublishableKey | Promise<EndstatePublishableKey>);
  tapSources?: readonly TapSource[]; // defaults to defaultTapSources()
}
```

`createEndstateClient` is the vanilla (non-React) entry point, exported from the `@endstate-sdk/web` root. It is a thin factory over core's [`EndstatePublicClient`](/sdks/core/reference/client/EndstatePublicClient) that defaults `tapSources` to [`defaultTapSources()`](/sdks/web/reference/tap-sources/defaultTapSources) - the landing redirect plus in-page Web NFC where supported. Prefer it over `new EndstatePublicClient(...)`: it wires the browser tap sources for you and keeps the client construction in one place.

React apps do not call this directly - [`EndstateProvider`](/sdks/web/reference/react/EndstateProvider) builds the client for you.

## Example

```ts theme={null}
import { createEndstateClient } from "@endstate-sdk/web";

const client = createEndstateClient({
  publishableKey: "end_pk_...",
});

// Capture the landing tap and open a session.
const tap = await client.captureTap();
if (tap) {
  const session = await client.verify(tap);
}
```

## Parameters

<ParamField body="publishableKey" type="EndstatePublishableKey | (() => EndstatePublishableKey | Promise<EndstatePublishableKey>)" required>
  Your publishable key (`end_pk_...`), or a function returning one (sync or
  async). A secret key is rejected by the type and again at runtime. Narrow and
  validate a string with
  [`publishableKey()`](/sdks/core/reference/browser/publishableKey).
</ParamField>

<ParamField body="tapSources" type="readonly TapSource[]">
  Tap sources to register. Defaults to
  [`defaultTapSources()`](/sdks/web/reference/tap-sources/defaultTapSources)
  (redirect + Web NFC). Pass your own set to add or reorder sources.
</ParamField>

<ParamField body="baseUrl" type="string">
  Overrides the API base URL. Leave it unset in product code. Any other core
  client-config option passes straight through to `EndstatePublicClient`.
</ParamField>

## Returns

[`EndstatePublicClient`](/sdks/core/reference/client/EndstatePublicClient) - a
browser client holding only the publishable key, ready to
[`captureTap()`](/sdks/core/reference/browser/captureTap) and
[`verify()`](/sdks/core/reference/client/verify).

## See also

<CardGroup cols={2}>
  <Card title="EndstatePublicClient" icon="box" href="/sdks/core/reference/client/EndstatePublicClient">
    The client this factory returns.
  </Card>

  <Card title="defaultTapSources" icon="scan-line" href="/sdks/web/reference/tap-sources/defaultTapSources">
    The tap sources it registers by default.
  </Card>

  <Card title="EndstateProvider" icon="square-code" href="/sdks/web/reference/react/EndstateProvider">
    The React path that builds this client for you.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/sdks/web/quickstart">
    The full tap-to-claim flow end to end.
  </Card>
</CardGroup>
