Getting Started
1. Create Your Application
Go to app.simple-login.com and create an account. Create a new application to get your Client ID and Client Secret.
2. Install the SDK
npm install @simple-login/sdk
3. Configure
Add these environment variables:
# Server-side ALWAYS
SIMPLELOGIN_CLIENT_SECRET=your_client_secret
VITE_SIMPLELOGIN_CLIENT_ID=your_client_id
VITE_SIMPLELOGIN_CLIENT_ID=your_slug
VITE_SIMPLELOGIN_REDIRECT_URI=https://yourapp.com/auth/callback
VITE_SIMPLELOGIN_ORIGIN=https://yourapp.com
| Variable | Description |
|---|---|
CLIENT_ID | Your application’s public identifier |
SLUG | Your application’s slug |
CLIENT_SECRET | Keep this secure, never expose client-side |
REDIRECT_URI | Where users return after login |
ORIGIN | Your app’s origin, used for CSRF protection |
4. Create Your Auth Instance
Create a shared instance in your app. The SDK caches keys internally, so reusing a single instance improves performance.
// app/lib/simpleLogin.ts
import { SimpleLogin } from '@simple-login/sdk'
export const simple = new SimpleLogin()
The SDK reads from environment variables automatically. You can also pass config explicitly:
export const simple = new SimpleLogin({
clientId: 'your_client_id',
clientSecret: 'your_client_secret',
redirectUri: 'https://yourapp.com/auth/callback',
origin: 'https://yourapp.com',
})