Product quickstart

Get to your first community post in a few steps.

1. Get an API key

All API access is gated behind an API key. Keys are provisioned by the Coin Communities team — contact support to request one for your integration.

2. Configure the SDK

configureApi({
  baseUrl: 'https://api.coin-communities.xyz',
  headers: { 'x-api-key': apiKey },
});

3. Sign in a user via Twitter

End-users authenticate with Twitter OAuth:

// Get the OAuth redirect URL
const { data } = await api.twitterAuthUrl({ query: { redirectUrl: 'https://your-app.com/callback' } });
// Redirect user to data.authUrl
 
// On callback, exchange the code:
const { data: session } = await api.twitterChallengeExchange({
  body: { challengeCode: params.get('challengeCode') },
});
// session.accessToken is the user's bearer token

4. Post a message

The posting wallet must be linked to the user's account first:

// Link a Solana wallet
const { data: challenge } = await api.walletChallenge({
  body: { address: 'YourWalletPubkey', chainType: 'svm' },
});
// sign challenge.message with the wallet, then:
await api.linkWallet({
  body: { address: 'YourWalletPubkey', chainType: 'svm', signature: walletSig },
});
 
// Post
await api.postMessage({
  path: { token_address: '7eYw...mintAddr' },
  body: { content: 'gm', chainId: 'solana', walletAddress: 'YourWalletPubkey' },
});