npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anujyadav070/frontier-sdk

v1.0.7

Published

TypeScript SDK for Frontier authentication system

Readme

Frontier Auth SDK

A lightweight TypeScript SDK for authentication with your Frontier backend application. Currently supports user registration and login functionality.

Installation

npm install @anujyadav070/frontier-sdk

Quick Start

import FrontierAuth from '@anujyadav070/frontier-sdk';

const auth = new FrontierAuth();

auth
  .setEndpoint('https://your-backend.com/v1')
  .setProject('your-project-id');

// Sign up new user
const user = await auth.account.create('unique-id', '[email protected]', 'password', 'John Doe');

// Login user
const session = await auth.account.createEmailSession('[email protected]', 'password');

Current Features

  • ✅ User registration (Sign up)
  • ✅ Email/password authentication (Login)
  • ✅ TypeScript support
  • ✅ HTTP client with automatic error handling
  • ✅ Configurable endpoint and project settings

API Reference

Client Configuration

const auth = new FrontierAuth();

// Set your backend endpoint
auth.setEndpoint('https://your-backend.com/v1');

// Set project ID
auth.setProject('your-project-id');

// Set API key (for server-side usage)
auth.setKey('your-api-key');

// Set JWT token (for authenticated requests)
auth.setJWT('your-jwt-token');

Authentication Methods

Sign Up

Create a new user account:

const user = await auth.account.create(
  'unique-user-id',    // User ID (must be unique)
  '[email protected]',  // Email address
  'securePassword',    // Password
  'John Doe'           // Name (optional)
);

console.log(user);
// Returns User object with: $id, $createdAt, $updatedAt, name, email, emailVerification, status

Login

Authenticate user with email and password:

const session = await auth.account.createEmailSession(
  '[email protected]',  // Email address
  'securePassword'     // Password
);

console.log(session);
// Returns Session object with: $id, userId, expire, provider, ip, device info, etc.

Error Handling

import { FrontierException, AuthException } from 'frontier-auth-sdk';

try {
  await auth.account.createEmailSession('[email protected]', 'wrong-password');
} catch (error) {
  if (error instanceof AuthException) {
    console.log('Authentication failed:', error.message);
  } else {
    console.log('Error:', error.message);
  }
}

Complete Example

import FrontierAuth from 'frontier-auth-sdk';

async function main() {
  // Initialize SDK
  const auth = new FrontierAuth();
  
  // Configure
  auth
    .setEndpoint('https://your-backend.com/v1')
    .setProject('your-project-id');

  try {
    // Sign up new user
    console.log('Creating account...');
    const user = await auth.account.create(
      'user-123',
      '[email protected]',
      'securePassword123',
      'John Doe'
    );
    console.log('User created:', user);

    // Login user
    console.log('Logging in...');
    const session = await auth.account.createEmailSession(
      '[email protected]',
      'securePassword123'
    );
    console.log('Login successful:', session);

  } catch (error) {
    console.error('Error:', error.message);
  }
}

Development

# Install dependencies
npm install

# Build the SDK
npm run build

# Watch for changes during development
npm run dev

License

ISC

Contributing

This SDK is currently in development. More authentication features will be added in future versions.