@profilex/sdk
v1.2.0
Published
TypeScript SDK for ProfileX API - Generate banners, badges, analytics, and more
Maintainers
Readme
@profilex/sdk
TypeScript SDK for ProfileX API - Generate banners, badges, analytics, and more.
Installation
npm install @profilex/sdkUsage
import { ProfileXClient } from '@profilex/sdk';
const client = new ProfileXClient({
token: 'your-profilex-token',
baseURL: 'https://api.profilex.com'
});
// Get a profile banner
const bannerUrl = await client.getBanner('johndoe', {
theme: 'dark',
size: 'large'
});
// Get analytics data
const analytics = await client.getAnalytics('johndoe', {
period: '30d'
});
// Record events
await client.recordEvent({
type: 'banner.render',
profileId: 'johndoe',
metadata: { format: 'svg' }
});API Methods
getBanner()- Generate profile bannersgetCommitGraph()- Get commit graph SVGsgetBadge()- Generate Shields-like badgesgetEmbed()- Get embed codesgetAnalytics()- Fetch analytics datagetAnalyticsSummary()- Get analytics summaryrecordEvent()- Record telemetry eventsgetProfile()- Get profile dataupdateProfile()- Update profile data
Authentication
Use ProfileX-Token v2 for authentication:
const client = new ProfileXClient({
token: 'PXTK_...'
});License
MIT
