Skip to main content

@krakentech/blueprint-auth

@krakentech/blueprint-auth is a comprehensive authentication library that provides type-safe, production-ready authentication utilities for Next.js applications integrating with the Kraken API. It supports both the Pages Router and App Router patterns, offering flexible authentication flows including email/password login, OAuth, masquerade mode, and anonymous access.

Key Features​

  • Multiple Authentication Methods: Email/password, Kraken OAuth, staff masquerade, anonymous access, and organization-scoped authentication
  • Router Agnostic: Full support for both Next.js Pages Router and App Router
  • Unified Configuration: Single config object shared across client, server, and middleware
  • Type-Safe: Built with TypeScript for comprehensive type safety across client and server
  • GraphQL Integration: Authenticated GraphQL client utilities for seamless Kraken API integration
  • Session Management: Secure cookie-based session handling with automatic token refresh
  • Middleware Support: Route protection and authentication checks via Next.js middleware

Getting Started​

Choose your Next.js routing pattern to get started:

Documentation​

  • API Reference - Complete API documentation for all exported functions and hooks
  • Migration Guides - Upgrade guides for breaking changes and new versions

Authentication Guides​

Tutorials​

Installation​

This package is published as a private npm package and requires an npm organisation access token:

pnpm add @krakentech/blueprint-auth
Private package

Please get in touch if you need an npm organisation access token.