Coin Communities by Pump.fun: Quickstart Guide for Token Community Chat
Learn how Coin Communities by Pump.fun works, how to create an API key, configure the SDK, sign in users with Twitter OAuth, link wallets, and post token community messages.
Introduction
Coin Communities by Pump.fun gives Solana apps a ready-made community layer for token conversations. The model is simple: every conversation is tied to a token address, users sign in through Twitter OAuth, wallets are linked through a signed Solana challenge, and messages are posted into the community for that token.
For a token page, that means chat can sit beside price, holders, swaps, and metadata without building a separate social graph or message system from scratch. For developers, the important parts are the business account, the API key, SDK configuration, Twitter OAuth, wallet linking, and message posting.
This guide follows the official Coin Communities product quickstart and turns it into a practical implementation path for a production app.
What Coin Communities Is
Coin Communities is an API and SDK for token-based community chat. A message is not just a generic chat message. It belongs to a token community through the token address passed in the request path.
The official quickstart shows a flow built around six pieces:
- A business account for API access
- A JWT returned after business login
- An API key created from that JWT
- SDK configuration with
https://api.coin-communities.xyz - Twitter OAuth for end-user authentication
- Solana wallet linking before a user can post
This gives token apps a cleaner split between business access and user identity. Your app owns the product surface. Coin Communities handles the community identity flow and message API.
Why Token Apps Need This
Most token pages already have dense market data: price, volume, liquidity, swaps, holders, developer history, and charts. The missing piece is often context from people watching or trading the asset.
A token community chat adds that context directly where users already make decisions. It can support:
- Token page comment streams
- Pump.fun launch discussions
- Trading terminal chat panels
- Community tabs inside analytics dashboards
- Wallet-linked posting for stronger identity signals
The key detail is that the community is scoped by token address. If the active token mint changes, the community changes with it.
Step 1: Register a Business Account
All API access is gated behind a business account. The quickstart starts with registration, email verification, and login.
await api.register({
body: {
businessName: 'My App',
email: '[email protected]',
password: '...',
},
});
const { data } = await api.login({
body: {
email: '[email protected]',
password: '...',
},
});
After the email is verified, login returns a JWT. That JWT is not the same thing as a public app API key. It is used for account-level actions, including creating an API key.
In a real app, keep this business login flow separate from your user-facing product. It is part of setup and administration, not something end users should touch.
Step 2: Create an API Key
Once you have a JWT, configure the SDK with that JWT and create an API key.
configureApi({
baseUrl: 'https://api.coin-communities.xyz',
auth: jwt,
});
const { data } = await api.createApiKey({
body: { name: 'production' },
});
const apiKey = data.key;
The quickstart notes that data.key is shown only once. Store it immediately. For production, keep it in your server environment or secret manager.
A good naming convention is to create separate keys per environment:
developmentstagingproduction
That makes rotation easier and keeps local testing separate from live traffic.
Step 3: Configure the SDK
For regular API requests, configure the SDK with the Coin Communities base URL and your API key.
configureApi({
baseUrl: 'https://api.coin-communities.xyz',
headers: { 'x-api-key': apiKey },
});
This is the basic configuration used by the examples in the quickstart. The base URL is:
https://api.coin-communities.xyz
The API key is sent as x-api-key.
In a Next.js app, this is usually done inside server-side route handlers or a small API wrapper. That keeps credentials out of your client bundle and gives you one place to handle errors, validation, retries, and logging.
Step 4: Sign In a User With Twitter OAuth
End users authenticate with Twitter OAuth. The quickstart starts by requesting an OAuth redirect URL from Coin Communities.
const { data } = await api.twitterAuthUrl({
query: {
redirectUrl: 'https://your-app.com/callback',
},
});
Your app redirects the user to data.authUrl. After the user completes the Twitter flow, Coin Communities redirects back to your callback URL with a challenge code.
On the callback route, exchange that challenge code for a user session.
const { data: session } = await api.twitterChallengeExchange({
body: {
challengeCode: params.get('challengeCode'),
},
});
const accessToken = session.accessToken;
The returned accessToken is the user's bearer token. Store it securely. In web apps, an httpOnly cookie is usually the right place because it avoids exposing the token to browser JavaScript.
Redirect URL Whitelisting
The redirect URL you send to twitterAuthUrl must match a whitelisted URL in the Coin Communities configuration. If it is not whitelisted, the API returns an error like:
redirect_url is not whitelisted
For local development, whitelist the exact callback URL you use, for example:
http://localhost:3000/communities/auth/callback
For production, whitelist your production callback URL, for example:
https://your-app.com/communities/auth/callback
Use the same path in your app and in the Coin Communities dashboard. Small differences matter, including protocol, host, port, and path.
Step 5: Link a Solana Wallet
Twitter OAuth signs in the user, but posting also requires a linked Solana wallet. The quickstart shows a challenge and signature flow.
First, request a wallet challenge.
const { data: challenge } = await api.walletChallenge({
body: {
address: 'YourWalletPubkey',
chainType: 'svm',
},
});
Then ask the connected wallet to sign challenge.message. After signing, submit the address, chain type, and signature.
await api.linkWallet({
body: {
address: 'YourWalletPubkey',
chainType: 'svm',
signature: walletSig,
},
});
The chainType in the quickstart is svm, which identifies the Solana Virtual Machine wallet flow.
This step matters because messages should come from a real wallet-controlled identity, not only a social login. A user can be authenticated with Twitter and still need to link a wallet before posting.
Step 6: Post a Message
Once the user is signed in and the wallet is linked, the app can post a message to a token community.
await api.postMessage({
path: {
token_address: '7eYw...mintAddr',
},
body: {
content: 'gm',
chainId: 'solana',
walletAddress: 'YourWalletPubkey',
},
});
The token address is passed in the path as token_address. The body includes:
content: the message textchainId:solanawalletAddress: the linked Solana wallet public key
For a token page, use the current token mint as token_address. If the user switches from one token to another, the app should fetch and post against the new token address.
A Clean Production Flow
A practical integration can be split into read and write paths.
For setup:
- Register a business account.
- Verify the email.
- Log in and receive a JWT.
- Create an API key.
- Store the API key in server environment variables.
For app runtime:
- Configure the SDK with
https://api.coin-communities.xyzandx-api-key. - Load community data for the current token.
- Let users read community messages without forcing a sign-in step.
- When a user tries to post, start Twitter OAuth.
- Exchange the challenge code on your callback route.
- Link the connected Solana wallet with a signed challenge.
- Submit the message with
postMessage.
This keeps the first-load experience fast. Users can read first and authenticate only when they want to participate.
Recommended Environment Variables
For a server-rendered app or API proxy, use environment variables that separate server secrets from client-safe values.
COIN_COMMUNITIES_API_KEY=your_api_key
COIN_COMMUNITIES_BASE_URL=https://api.coin-communities.xyz
NEXT_PUBLIC_COIN_COMMUNITIES_BASE_URL=https://api.coin-communities.xyz
The public base URL can be used by browser code when needed. The API key should stay server-side unless you are intentionally making a public SDK call that the Coin Communities API supports with x-api-key.
Error Handling to Plan For
The quickstart flow has a few predictable failure points.
The redirect URL is not whitelisted
Whitelist the exact callback URL used in twitterAuthUrl.
The user is signed in but cannot post
Check whether the wallet has been linked. Twitter OAuth alone is not enough for posting.
The wallet challenge cannot be signed
Make sure the connected wallet supports message signing. If it does not, show a clear message and ask the user to use a compatible Solana wallet.
The token address is wrong
Messages are scoped by token address. Validate the mint address before calling postMessage.
API Calls From the Quickstart
The official quickstart introduces these SDK calls:
api.registerapi.loginapi.createApiKeyapi.twitterAuthUrlapi.twitterChallengeExchangeapi.walletChallengeapi.linkWalletapi.postMessage
Together, they cover the core lifecycle: business setup, API key creation, user authentication, wallet linking, and message posting.
What to Build First
For most apps, start with the smallest complete path:
- Configure the SDK with your API key.
- Add a token community panel to one token page.
- Add a post button that starts Twitter OAuth.
- Add the callback route and token storage.
- Add wallet challenge signing.
- Call
postMessagefor the current token address.
Once that works, add polish: loading states, linked-wallet status, better errors, empty states, and moderation-aware UI.
Why This Is Useful for Pump.fun Tokens
Pump.fun tokens move fast. A token can go from launch to heavy attention in minutes. Community context matters during that window because users want to know who is watching, what holders are saying, and whether there is actual activity around the coin.
Coin Communities gives those conversations a consistent home tied to the token address. That makes it a strong fit for Pump.fun discovery pages, token detail pages, and trading products that already track new launches.
Final Checklist
Before shipping, confirm these items:
- Business account is registered and verified
- API key is created and stored securely
- SDK uses
https://api.coin-communities.xyz - Requests send
x-api-key - Twitter callback URL is whitelisted
- OAuth callback exchanges the challenge code
- User access token is stored securely
- Wallet challenge uses
chainType: 'svm' - Posting uses
chainId: 'solana' - The active token mint is passed as
token_address
If those are in place, you have the core Coin Communities flow ready for a token community chat experience.
FAQ
What is Coin Communities by Pump.fun?
Coin Communities is an API and SDK for token-based community chat. It lets apps connect messages to token addresses and support authenticated posting through Twitter OAuth and linked Solana wallets.
Do I need an API key?
Yes. The official quickstart starts with a business account, then uses a JWT to create an API key. The SDK is configured with x-api-key for regular requests.
How do users sign in?
Users sign in through Twitter OAuth. Your app calls twitterAuthUrl, redirects the user to the returned URL, then exchanges the callback challenge code with twitterChallengeExchange.
Why does posting require wallet linking?
Coin Communities requires the posting wallet to be linked to the user's account. The app requests a wallet challenge, the user signs it, and the app submits the signature with linkWallet.
What chain values does the quickstart use for Solana?
The wallet challenge uses chainType: 'svm'. Posting uses chainId: 'solana'.
What causes a redirect URL whitelist error?
The callback URL sent to twitterAuthUrl is not in the allowed redirect URLs. Whitelist the exact local or production callback URL.
Source
This guide is based on the official Coin Communities product quickstart.