Skip to main content

Package Installation

Basic Setup

Credentials

You’ll need three credentials from your Refine dashboard:
Never expose your API key in client-side code for production. Use environment variables and server-side rendering for sensitive operations.

Environment Variables

Next.js

.env.local
lib/refine.ts

Vite

.env
src/lib/refine.ts

TypeScript Support

The SDK is written in TypeScript and includes full type definitions. No additional @types packages are needed.

Singleton Pattern

For most applications, create a single SDK instance and export it:
lib/refine.ts
pages/search.tsx

CDN Usage

For non-bundled environments, load directly via CDN:
CDN usage exposes your API key. Only use this for prototyping or internal tools.

Verify Installation

Test your setup:

Next Steps

Configuration

Explore all configuration options

Quickstart

Build your first search