Skip to main content
The @gately/react SDK provides production-ready authentication for React applications with a hooks-based API and automatic state management.
Version: @gately/react@2.2.0
Features: useGately hook, GatelyProvider context, TypeScript support, SSR support

Installation

Or install a specific version:
Get your API key: Dashboard → Settings → API Keys

Quick Start

GatelyProvider

Wraps your app to provide authentication context. Must be a parent of any component using useGately.

useGately Hook

The main hook — provides all auth state and methods.

State

Methods

Authentication Examples

Login Form

Sign Up

Route Protection

With React Router

User Profile

Other Hooks

useAuth

Returns the full auth context (same as useGately):

useUser

Focused hook for user profile data:

useProtected

Simple auth status check:

TypeScript

Testing

Next Steps

Next.js SDK

Add server-side auth and middleware

Node.js SDK

Backend token verification
Support: support@usegately.com · Slack Community