Fency.ai

Getting started

Get started with Fency.ai in minutes using the React SDK.

Fency.ai provides seamless LLM integration for React webapps. Get started in minutes with our React SDK and start building AI-powered features.

Quick start

To get started with Fency.ai in your React application:

  1. Log in: Log in to your Fency.ai account
  2. Obtain publishable and secret keys: Generate your first publishable key and secret key in the dashboard
  3. Install the React SDK:
npm install --save @fencyai/js @fencyai/react
  1. Set up endpoints: Create backend endpoints for stream sessions and agent task sessions. See Sessions and client tokens.

Then provide your publishable key to loadFency and wrap your app in FencyProvider:

import { loadFency } from '@fencyai/js'
import { FencyProvider } from '@fencyai/react'

const fency = loadFency({ publishableKey: 'pk_your_publishable_key' })

const fetchCreateStreamClientToken = async () => {
    const res = await fetch('/api/stream-client-token', { method: 'POST' })
    if (!res.ok) throw new Error('Failed to create stream client token')
    const data = await res.json()
    if (!data.clientToken) throw new Error('No clientToken in response')
    return { clientToken: data.clientToken }
}

export default function App() {
    return (
        <FencyProvider
            fency={fency}
            fetchCreateStreamClientToken={fetchCreateStreamClientToken}
        >
            <div />
        </FencyProvider>
    )
}

For a fully functioning setup, see the integration examples and the fency-react-examples repository.

Supported models

Fency.ai supports leading LLM models from Anthropic, Google, and OpenAI:

  • Anthropic: Claude Haiku 4.5, Claude Sonnet 4.5, Claude Opus 4.5, Claude Sonnet 4.6, Claude Opus 4.6
  • Google: Gemini 2.5 Flash, Gemini 2.5 Flash Lite, Gemini 2.5 Pro
  • OpenAI: GPT-4.1-nano, GPT-4.1-mini, GPT-4.1, GPT-5-mini, GPT-5-nano

On this page