Package Installation
Install the Sylphx Platform SDK using your preferred package manager:
npm install @sylphx/platform-sdkRequirements
Node.js 18+
Server runtime environment
React 18+
For React hooks and components
Next.js 13.4+
For middleware and server features
TypeScript
Full type definitions included
Type Safety
All SDK methods are fully typed. Your IDE will provide autocomplete and type checking out of the box.
Framework Entry Points
The SDK provides framework-specific entry points for optimal integration:
Next.js App Router
// Server components and middleware
import { auth, currentUser, authMiddleware } from '@sylphx/platform-sdk/nextjs'
// Client components
import { useUser, useAuth, SignIn, UserButton } from '@sylphx/platform-sdk/react'React (Vite, CRA, etc.)
// Client-side only
import { SylphxProvider, useUser, useAuth, SignIn } from '@sylphx/platform-sdk/react'Node.js / Server
// Server-side API client
import { createPlatformAPI } from '@sylphx/platform-sdk'Entry Points Reference
| Property | Type | Description |
|---|---|---|
@sylphx/platform-sdk | Server | Core API client for server-side usage |
@sylphx/platform-sdk/react | Client | React hooks, components, and context provider |
@sylphx/platform-sdk/nextjs | Next.js | Middleware, server functions, and Next.js-specific utilities |
Peer Dependencies
Some features require additional peer dependencies:
| Property | Type | Description |
|---|---|---|
React Hooks | react >= 18.0 | Required for useUser, useAuth, and other hooks |
Next.js Integration | next >= 13.4 | Required for middleware and server functions |