Skip to content
totym
Menu

THE TOTYM SDK / @totym/sdk

Build the door
into anything.

Turn what a wallet holds into what your app opens. One ownership check can change a whole site, a page, or a single line.

npm install @totym/sdk

Published on npm · Solana, Ethereum, Base and Robinhood Chain · server-side checks

ACCESS ENGINE / SIMULATION● LIVE MODEL
ACCESS RESULTAWAITING PROOF

No qualifying holding. The gate stays closed.

01 / OWNERSHIP → ACCESS
01 / INSTALLABLE SDK02 / SERVER VERIFICATION03 / THREE CHAINS04 / SIX PUBLIC ENDPOINTS

01 / GRANULARITY

ONE PRIMITIVE. ANY SCALE.

The smallest thing
can be the whole point.

Choose where the door lives. The ownership rule stays the same; the experience around it is yours.

APPLICATION / COMPONENTACCESS REQUIRED

<MemberChart /> / Gated

One component.

Put a chart or feed behind a gate while the rest stays public.
YOUR INTERFACE TOTYM UNDERNEATH

02 / THE GATE LAB

INTERACTIVE SIMULATION

Four ways to
hold the door.

Switch the locked state. Then simulate a holder to see what opens. This is a visual model of the SDK behavior, not a live wallet check. Three of the four decide what a visitor SEES; only TotymServerGate decides what gets sent.

Content withheldAbsent from the DOM for this non-holder — but it was sent. view-source finds it; this inspector does not.

STYLE / BLOCK

Block the content.

The protected children really are absent from the DOM — the Elements inspector shows nothing. But they were sent: React serialises a client component's children before the component runs, so the text sits in the response body and view-source finds it. The DOM is clean; the response is not. Use TotymServerGate when it must not be sent at all.

TSX / EXAMPLESDK PROP
<TotymReveal tier="holder" style="block">
  <Members />
</TotymReveal>

For sensitive data, verify on the server before returning it.

03 / THE PRIMITIVE

WALLET STATE, INTO PRODUCT STATE.

The rule lives
beneath the design.

Use Totym to decide access. Keep the interface yours. A gate can sit around the precise thing ownership should open.

View the published package
YOUR APP / TSX01 OF 01
import { TotymProvider, TotymReveal } from "@totym/sdk";

<TotymProvider apiUrl="YOUR_TOTYM_API_URL">
  <TotymReveal mint="TOKEN_MINT_ADDRESS" chain="solana">
    <PromoCode />
  </TotymReveal>
</TotymProvider>

Starter pattern. Supply your API URL and token mint. You can pass your wallet address to TotymProvider when your app already manages wallet connections.

01Connect

A wallet connects through your experience.

02Verify

The access decision checks ownership on the server.

03Open

Your application renders the qualifying view.

04 / REFERENCE

THE PUBLISHED SURFACE.

Everything on the table.

The public exports and endpoints of @totym/sdk. Consult the published type declarations for signatures and parameters.

SDK exports

11
Public SDK exports
NameKindPurpose
proveWalletfunctionProve the visitor controls the wallet — signed challenge, short-lived token
requireTotymAccessserverServer-side guard. From @totym/sdk/server
bearerFromserverRead the token out of request headers
TotymServerGaterscDecides on the server before rendering — withheld children are never sent. From @totym/sdk/rsc
sessionCookierscBuild the Set-Cookie value the server gate reads
TOTYM_SESSION_COOKIErscThe cookie name it reads, so you never guess it
TotymUnavailableErrorserverThe check could not be COMPLETED — never means denied
TotymProofErrorclassproveWallet failed; carries the HTTP status
TotymProvidercomponentApp configuration, wallet and access cache
TotymRevealcomponentBlock, fade or blur gated children in the browser — hides, does not withhold
TotymGatecomponentDeprecated alias for TotymReveal, kept so an upgrade does not break a build
TotymTiercomponentSelect the highest qualifying tier
TotymWallcomponentDefault locked state and buy link
TotymButtoncomponentWallet connection for either ecosystem
useTotymAccesshookRead access state for a query
useTotymTierhookRead the qualifying tier name
useTotymWallethookRead the connected wallet and ecosystem
defineConfigfunctionType a community and tier configuration. From @totym/sdk/config in a server file
detectChainfunctionDetect Solana or EVM address shape. Also at @totym/sdk/config
clearCachefunctionInvalidate the client access cache
EVM_CHAIN_IDSconstantChain ids for the EVM chains the API serves. Also at @totym/sdk/config

Public endpoints

12

six of these are CORS-open, so a browser on any origin can read them. Every example below returns 200 — paste one. The whole surface is also machine-readable at /api and /llms.txt, both generated from the same declaration as this table.

Public endpoints, with a worked example for each
PathChainReturns
/api/sdk/challenge/api/sdk/challengeSolana · EVMA single-use nonce and the exact message to sign
/api/sdk/session/api/sdk/sessionSolana · EVMA short-lived token, in exchange for a signature over the challenge
/api/sdk/access/api/sdk/accessSolana · EVMA verified access decision — allow, deny or unknownNo wallet parameter exists on this route. The token proves the address, which is the difference between this and the lookups below.
/api/check-access/api/check-access?wallet=6J8eyphbPTvvUtswqbcfxSdZJF88pbWFoeYmYcN7pD4c&mint=So11111111111111111111111111111111111111112&minimum=0SolanaThe balance an address holds of a mint, and whether it clears a minimumAnswers about an address the CALLER supplied, so every response carries verified: false. Gating on it opens the door for anyone who pastes a whale's address. Use /api/sdk/access for a decision.
/api/check-access-evm/api/check-access-evm?wallet=0x6262032b8a6f82d7c63897bc44288f76753f8442&contract=0x4200000000000000000000000000000000000006&chain_id=8453&gate_type=erc20&minimum=0Ethereum · Base · Robinhood ChainThe same, for EVM chainsSame verified: false caveat as the Solana lookup.
/api/token-metadata/api/token-metadata?mint=So11111111111111111111111111111111111111112SolanaName, symbol, logo and supply for a mint
/api/token-metadata-evm/api/token-metadata-evm?contract=0x4200000000000000000000000000000000000006&chain_id=8453Ethereum · Base · Robinhood ChainThe same, for an ERC-20 or ERC-721 contract
/api/holder-count/api/holder-count?mint=So11111111111111111111111111111111111111112SolanaHow many addresses hold a mint
/api/profile/api/profile?wallet=6J8eyphbPTvvUtswqbcfxSdZJF88pbWFoeYmYcN7pD4cSolana · EVMA wallet's Totym profile, with ENS and .sol names where they resolve
/api/communities/api/communities?limit=10Solana · EVMsame-originPublished communities, with each one's gate, chain and token
/api/communities/count/api/communities/count—same-originPopulation counts — published, paused, unclaimed listings, test, archived, total rows, and membershipsThe populations are named, not partitioned — a devnet row can also be archived — so they deliberately do not sum to rows.
/api/health/api/health—same-originEvery dependency with its state, latency and what breaks without it. No provider text reaches the caller.
Inspect the SDK source on GitHub

The repository is useTotym/TotymSDK and the package is @totym/sdk. The published 0.3.0 still lists the pre-rename URL in its npm metadata — GitHub redirects it, and it corrects on the next publish rather than being something you need to work around.

Closed source. Said plainly rather than left to be inferred from a missing link: the server that makes gate decisions is not currently something you can read. The commit below identifies the build you are served, and the SDK above is the part you can verify independently.

THE DOOR IS YOURS TO BUILD.

Give ownership
something to open.

Start with a component. Make it a whole world.

npm install @totym/sdk