← SDKs & libraries

SDK

@polymarket/client: Official TypeScript SDK

@polymarket/client is Polymarket's official unified TypeScript SDK, usable from TypeScript and JavaScript through npm. It separates credential-free market reads from authenticated trading and wallet actions.

Pricing
The package needs no subscription. Venue trading charges and infrastructure costs are separate.

Screenshots and interface

What is @polymarket/client?

PublicClient supplies public data; SecureClient adds account functions with supported Viem, Privy or Ethers signer adapters. Exported models and branded token, market, condition and address types distinguish identifiers and decimal strings deliberately.

A list paginator is created synchronously; firstPage() or asynchronous iteration performs fetching. Keep nextCursor unchanged and resume with from(cursor).firstPage(), omitting the cursor for a fresh scan. Older CLOB clients use different method and account conventions, so migration needs the current guide.

Who it is for

  • TypeScript market and trading applications.
  • Teams replacing legacy clients.
  • Consumers combining several real-time feeds.

Features and coverage

  • Public and secure clients

    Separate public data from signed account actions.

  • Typed models

    Use exported Event, Market and OrderBook response types.

  • Branded IDs

    Distinguish domain identifiers at compile time.

  • Pagination

    Iterate pages and retain opaque cursors.

  • Error guards

    Handle action-specific rate-limit and input errors; rethrow unexpected failures.

  • Wallet adapters

    Supported signer paths include Viem, Privy and Ethers.

  • Combined subscriptions

    Receive several topics through one event stream.

  • Resumable scans

    Fetch using firstPage() or async iteration and resume through from(cursor).firstPage().

Workflows with @polymarket/client

Build a typed market view

Create PublicClient, read a small page and retain token IDs for books.

Add account actions

Adapt the wallet signer, create SecureClient and inspect account identity before enabling actions.

Consume topics

Subscribe to public topics, narrow each event by type and call stream.close() when disposed.

Resume an interrupted scan

Persist nextCursor after processing each page. Reuse intended filters, pace requests and handle RateLimitError or UserInputError with the action guard while rethrowing unexpected errors.

Pricing and total cost

The package needs no subscription. Venue trading charges and infrastructure costs are separate.

Getting started

Before you start: PublicClient does not supply private account streams.

  1. Install @polymarket/client from the official package.
  2. Create PublicClient and read active markets.
  3. Implement pagination and documented errors.
  4. Add a signer and SecureClient only for account functions.
  5. Use the current migration guide for legacy clients.

SDK cursors are opaque and must be stored unchanged.

Read the TypeScript SDK guide

Useful links

What to check

  • PublicClient does not supply private account streams.
  • Decimal strings and domain IDs have deliberately distinct types.
  • Legacy CLOB clients have different methods and account conventions.

A closer look

Ratings & reviews

Editorial rating
4.0/ 5
0 user reviews

Our take on @polymarket/client

Typed identifiers and a clear public/account split make this a well-documented TypeScript starting point. Moving from older clients still requires deliberate migration.

Based on documented features, setup and access terms. How we rate

User reviews 0

The main score switches to user ratings after 5 published reviews.

Be the first to share your experience

A specific example helps the next person choose the right tool.

Related tools

Browse category

Frequently asked questions about @polymarket/client

Which package is the unified SDK?

@polymarket/client.

Do public reads need a private key?

No. Start with createPublicClient.

Can several topics share a stream?

Yes. Subscriptions accept multiple topic specifications, including sports and markets.

How do I resume?

Store nextCursor unchanged and resume through the paginator.

How do I stop a stream?

Call stream.close() on disposal. Public subscriptions exist on public and secure clients; account actions still need suitable signers and permissions.