Complete reference for all Sylphx Platform SDK methods.
10 Services
Full-stack coverage
50+ Methods
Everything you need
TypeScript
Full type safety
Examples
Copy-paste ready
Authentication methods for user login, signup, and session management
Authenticate a user with email and password
| string | User email address | |
| password | string | User password |
TokenResponse with accessToken and refreshToken
const result = await platform.auth.login({
email: 'user@example.com',
password: 'password123',
})Register a new user account
| string | User email address | |
| password | string | User password (min 8 chars) |
| name | string? | User display name |
TokenResponse with accessToken and refreshToken
Revoke the current session
{ success: true }
Get a new access token using refresh token
Verify email with token from verification email
Send password reset email to user
Reset password using token from reset email
Subscription and payment management via Stripe
Get all available subscription plans
Array of Plan objects with pricing details
const plans = await platform.billing.getPlans()
// [{ id, name, price, interval, features, ... }]Get user's current subscription
Current subscription or null if none
Create Stripe checkout session
| planId | string | ID of plan to subscribe to |
| successUrl | string | Redirect URL after success |
| cancelUrl | string | Redirect URL if cancelled |
Object with Stripe checkout URL
Create Stripe billing portal session
Object with Stripe portal URL
Cancel user's subscription at period end
Event tracking and user analytics
Track a custom event
| event | string | Event name (e.g., "purchase_completed") |
| userId | string? | User ID (optional for anonymous) |
| properties | object? | Custom event properties |
await platform.analytics.track({
event: 'button_clicked',
userId: user.id,
properties: { buttonId: 'cta-hero' },
})Associate traits with a user
| userId | string | User ID to identify |
| traits | object | User traits (name, email, plan, etc.) |
Track a page view
| path | string | Page path |
| title | string? | Page title |
| referrer | string? | Referrer URL |
AI services including chat, embeddings, and image generation
Generate chat completion
| model | string | Model ID (gpt-4, claude-3-opus, etc.) |
| messages | AIMessage[] | Conversation messages |
| temperature | number? | Sampling temperature (0-2) |
| maxTokens | number? | Max tokens to generate |
const response = await platform.ai.chat({
model: 'gpt-4',
messages: [
{ role: 'system', content: 'You are helpful.' },
{ role: 'user', content: 'Hello!' },
],
})
console.log(response.message.content)Generate text embeddings
| model | string | Embedding model ID |
| input | string | string[] | Text to embed |
Array of embedding vectors
Generate images from text
| model | string | Image model (dall-e-3, sdxl, etc.) |
| prompt | string | Image description |
| size | string? | Image size (1024x1024, etc.) |
Get AI usage statistics
Usage stats including tokens and cost
File upload and management
Upload a file
| file | File | Blob | File to upload |
| path | string? | Storage path |
| public | boolean? | Make file publicly accessible |
UploadedFile with URL and metadata
Delete a file
List uploaded files
Error capture and tracking
Capture an error/exception
| error | Error | string | Error to capture |
| context | object? | Additional context |
| userId | string? | User who experienced error |
try {
await riskyOperation()
} catch (error) {
await platform.monitoring.captureException({
error,
context: { operation: 'checkout' },
userId: user.id,
})
}Capture a message/warning
| message | string | Message to capture |
| level | string? | Severity: info, warning, error |
Background job scheduling
Schedule a background job
| url | string | Webhook URL to call |
| body | object? | Request body |
| delay | number? | Delay in seconds |
| cron | string? | Cron expression for recurring |
Cancel a scheduled job
GDPR/CCPA consent management
Get configured consent types
Get user's consent choices
Update user's consent choices
Accept all consent types
Decline all optional consents
Web push notifications
Get VAPID public key for subscription
Register a push subscription
Remove a push subscription
Referral program management
Get user's referral code
Redeem a referral code
Get user's referral statistics