@profilex/sdk-js
v1.2.0
Published
JavaScript SDK for ProfileX API - Generate banners, badges, analytics, and more
Maintainers
Readme
@profilex/sdk-js
JavaScript SDK for ProfileX API - Generate banners, badges, analytics, and more.
Installation
npm install @profilex/sdk-jsUsage
const { ProfileXClient } = require('@profilex/sdk-js');
// or
import { ProfileXClient } from '@profilex/sdk-js';
const client = new ProfileXClient({
token: 'your-profilex-token',
baseURL: 'https://api.profilex.com'
});
// Get a profile banner
client.getBanner('johndoe', {
theme: 'dark',
size: 'large'
}).then(bannerUrl => {
console.log('Banner URL:', bannerUrl);
});
// Get analytics data
client.getAnalytics('johndoe', {
period: '30d'
}).then(analytics => {
console.log('Analytics:', analytics);
});
// Record events
client.recordEvent({
type: 'banner.render',
profileId: 'johndoe',
metadata: { format: 'svg' }
}).then(result => {
console.log('Event recorded:', result);
});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
