Install and configure Linktree SDK/API authentication. Use when setting up a new Linktree integration. Trigger: "install linktree", "setup linktree", "linktree auth".
Set up Linktree API for programmatic link-in-bio management with 25M+ creators.
npm install @linktree/sdk
# or: pip install linktree-sdk
export LINKTREE_API_KEY="your-api-key-here"
echo 'LINKTREE_API_KEY=your-api-key' >> .env
import { LinktreeClient } from '@linktree/sdk';
const client = new LinktreeClient({ apiKey: process.env.LINKTREE_API_KEY });
const profile = await client.profiles.get('myprofile');
console.log(`Profile: ${profile.username} — ${profile.links.length} links`);
import linktree
client = linktree.Client(api_key=os.environ['LINKTREE_API_KEY'])
profile = client.profiles.get('myprofile')
print(f'Profile: {profile.username} — {len(profile.links)} links')
| Error | Code | Solution |
|---|---|---|
| Invalid API key | 401 | Verify credentials in dashboard |
| Permission denied | 403 | Check API scopes/permissions |
| Rate limited | 429 | Implement backoff |
After auth, proceed to linktree-hello-world.