Skip to main content
Use the creator dApp SDK when you want someone to sign in to your own website with OneSwap Wallet. You can give access to holders of your token, sell a pass in that token, or propose a reward for a connected member. You define the content, prices and reward rules. OneSwap handles wallet consent and transfer approval. Any token creator can register a site from My launches → dApps on OneSwap. Sign in with your OneSwap account to try the dApp sandbox. It uses sample data and works before you register a dApp. For an end-to-end integration test with your own site and test assets, use DevNet.

Register your website

  1. Sign in with the wallet that created the token. Select your token in My launches → dApps on DevNet or mainnet. Each token has one registered app. You can add multiple experiences inside it.
  2. Choose Register your website. Enter the name members should see, the exact HTTPS origin listed as your token’s official website and a return URL on that same origin. For example, use https://members.example.com and https://members.example.com/callback. Your server must handle that path.
  3. Under Website settings, generate the DNS TXT record, publish it and select Check verification. For a standard <project>.vercel.app origin, the dashboard also offers a file you can publish at the displayed path. The file must be public and return the displayed value without a redirect. Renew verification before the seven-day expiry shown in the dashboard.
  4. In Server keys, select Create server key. Copy the app ID and store the new secret in your backend’s secret manager, or download the backend configuration while the key is available. The secret is shown once. Keep the file out of source control, browser builds and logs.
  5. For a first holder experience, add a Holder requirement with ID holder and a minimum of one token. Under Experiences, create member-area, select the requirement and leave the price empty. Your backend checks that requirement before it serves the member area.

Install the SDK

Install version 0.2.0 from the npm registry in your backend project. The SDK requires Node.js 20 or newer. The bundled example below uses Node.js 22.13 or newer.
Import the server client only in backend code. Select the network explicitly and use the app ID, secret and return URL from that same network.
The browser entry point, @oneswap/dapp-sdk/browser, opens the OneSwap wallet for sign-in or checkout. It needs the network and a wallet link or payment ID. Keep the server secret and member access tokens on your backend.

Try the included member site

The package includes a working site with server-side sign-in, holder checks and a SQLite order store. Follow these steps on your verified DevNet origin.
  1. On your server, set DAPP_NETWORK=devnet, DAPP_ID, DAPP_SECRET, EXAMPLE_ORIGIN (the exact HTTPS origin, without a trailing slash) and RULE_ID=holder. Register <EXAMPLE_ORIGIN>/callback in the dashboard.
  2. From a writable working directory, run the command below. The site listens on 127.0.0.1:3481 by default. Forward your verified HTTPS origin to that process. Keep the SQLite file on persistent storage. Set EXAMPLE_DATABASE to choose its path.
  3. Open the site as a member and sign in. Review the listed requirement in OneSwap Wallet, allow the connection and return to your site. In My launches → dApps, select Check connection to confirm that your backend finished the exchange.
  4. Try a holder and a second account without the token. Both should be able to sign in. Only the consenting holder should see the protected area. For a paid test, use a different buyer wallet from the creator wallet.
The example keeps sessions in server memory. Use a shared server-side session store for a deployment with multiple instances. Rotate server keys before their 90-day expiry. Add the replacement, switch your backend and verify a fresh sign-in before revoking the old key. Revoking a key disconnects members authenticated with it.

Sign-in and holder access

Protect the first route in your own app.

Token checkout

Sell an item and verify settlement before delivery.

Treasury rewards

Propose awards and show each member their receipt.

Launchpad market data

Read token prices, market activity and public quotes.