Installation

2 min

Install the Sylphx Platform SDK in your project using your preferred package manager.

Package Installation

Install the Sylphx Platform SDK using your preferred package manager:

npm install @sylphx/platform-sdk

Requirements

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

PropertyTypeDescription
@sylphx/platform-sdkServerCore API client for server-side usage
@sylphx/platform-sdk/reactClientReact hooks, components, and context provider
@sylphx/platform-sdk/nextjsNext.jsMiddleware, server functions, and Next.js-specific utilities

Peer Dependencies

Some features require additional peer dependencies:

PropertyTypeDescription
React Hooksreact >= 18.0Required for useUser, useAuth, and other hooks
Next.js Integrationnext >= 13.4Required for middleware and server functions