Quickstart
You can get set up building with Tapestry in just 9 minutes with this quickstart guide. You can use either the socialfi NPM package (recommended for easier integration) or call the API directly.
Don't Have an App Yet?
🚀 Try the Solana Starter Kit first!
If you're starting from scratch, our starter kit provides a complete Solana app template with Tapestry social features, wallet authentication, token swapping, and more - all pre-configured and ready to run in minutes.
Already have an app? Continue below to integrate Tapestry's social features.
Get Your API Key
If you're integrating Tapestry into an existing app:
- Get your Tapestry API Key
- Set a namespace for your app. Each namespace is unique and helps distinguish your app's profiles, follows, content, likes, etc from those of the other apps built on Tapestry.
- That's it. Now you have what you need to start building!
Install the Socialfi Package (Recommended)
We recommend using the socialfi package as it provides a simpler, more convenient way to interact with Tapestry:
npm install socialfi
# or
yarn add socialfi
# or
pnpm add socialfi
Initialize the Client
Set up your Tapestry client:
Using the Socialfi Package
import { SocialFi } from 'socialfi';
const API_URL = 'https://api.usetapestry.dev/v1/'; // tapestry prod URL
// const API_URL = 'https://api.dev.usetapestry.dev/v1/'; // tapestry dev URL
const API_KEY = process.env.TAPESTRY_API_KEY; // Get your API key from https://app.usetapestry.dev/
const client = new SocialFi({
baseURL: API_URL,
apiKey: API_KEY,
});
Using the API Directly
If you prefer to call the API directly without the socialfi package, you can use fetch or your preferred HTTP client.
Create Your First Profile
Let's start by creating an onchain profile:
Using the Socialfi Package
async function createProfile() {
try {
const profile = await client.profiles.findOrCreateCreate(
{
apiKey: API_KEY,
},
{
walletAddress: 'YOUR_WALLET_ADDRESS',
username: 'johndoe',
bio: 'Hello World! This is my first Tapestry profile.',
blockchain: 'SOLANA',
execution: 'FAST_UNCONFIRMED'
}
);
console.log('Profile created:', profile);
return profile;
} catch (error) {
console.error('Error creating profile:', error);
}
}
Using the API Directly
async function createProfile() {
try {
const response = await fetch(
'https://api.usetapestry.dev/v1/profiles/findOrCreate?apiKey=YOUR_API_KEY',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
walletAddress: 'YOUR_WALLET_ADDRESS',
username: 'johndoe',
bio: 'Hello World! This is my first Tapestry profile.',
blockchain: 'SOLANA',
execution: 'FAST_UNCONFIRMED'
}),
}
);
const profile = await response.json();
console.log('Profile created:', profile);
return profile;
} catch (error) {
console.error('Error creating profile:', error);
}
}
What's Next?
Now that you have a basic setup, you can explore more features:
- Create User Profiles - Learn more about profile creation and management
- Implement Follows - Add follow/unfollow functionality
- Add Content Creation - Let users create and share posts
- Build Comments - Enable discussions on content
- Implement Likes - Add engagement through likes
Ready to dive deeper? Check out our complete documentation!