PollarPollar
SDK Reference

@pollar/react

React bindings for Pollar: provider, hook and UI component for authentication.

PollarProvider

Wraps the app and provides the API key and client context.

import { PollarProvider } from '@pollar/react';

<PollarProvider apiKey="your-api-key">
  <App />
</PollarProvider>

usePollar

Hook to access authentication state and login/logout actions.

import { usePollar } from '@pollar/react';

const { user, login, logout, isAuthenticated } = usePollar();

// Login by provider
await login('google');   // 'google' | 'github' | 'email' | 'freighter' | 'albedo'
await logout();

WalletButton

Ready-to-use component that opens a modal with all auth methods (Google, GitHub, Email OTP, Freighter, Albedo). Styles use the pollar- class prefix to avoid conflicts with your CSS.

import { WalletButton } from '@pollar/react';

<WalletButton />

Installation

npm install @pollar/core @pollar/react

On this page

Was this helpful?