@propelauth/byo-node
v1.0.4
Published
Node.js client library for PropelAuth BYO (Bring Your Own) authentication
Downloads
16
Readme
@propelauth/byo-node
Node.js client library for PropelAuth BYO (Bring Your Own) authentication - a self-hosted sidecar, written in Rust, that lets you add only the auth pieces you need, without replacing what already works.
Installation
npm install @propelauth/byo-nodeQuick Start
import { createClient } from "@propelauth/byo-node";
// Initialize the client
const client = createClient({
url: "http://localhost:2884", // Your BYO sidecar URL
integrationKey: "YOUR_INTEGRATION_KEY",
});
// Test the connection
const pingResult = await client.ping({});
if (pingResult.ok) {
console.log("Connected! Timestamp:", pingResult.data.timestamp);
} else {
console.error("Error", pingResult.error);
}Features
Each feature is modular and can be used independently:
- Session Management - Create, validate, and manage user sessions with security features like IP checks, new device notifications, and session theft protection.
- Impersonation - User impersonation for support
- Passkeys - Add Passkeys for authentication or MFA
- SSO - Enterprise SSO with OpenID Connect (OIDC)
- SCIM - User provisioning and deprovisioning
- Device Management - Track and manage user devices
Error Handling
All methods return a Result type with explicit, typed errors:
const result = await client.session.validate({
sessionToken: token,
ipAddress: req.ip,
});
if (result.ok) {
console.log("User ID:", result.data.userId);
} else if (result.error.type === "InvalidSessionToken") {
// Invalid or expired token
} else if (result.error.type === "DeviceVerificationFailed") {
// User registered a device, but made a request from an unrecognized device
}
// ...Documentation
For complete guides and API reference:
