Docs
Skip to content

Refine

Set up Appwrite_

Import and initialize Appwrite for your react application.

1 min read

Raw

Create project

Head to the Appwrite Console.

Create project screen
Create project screen

If this is your first time using Appwrite, create an account and create your first project.

Then, under Add a platform, add a Web app. The Hostname should be localhost.

Add a platform
Add a platform

You can skip optional steps.

Initialize Appwrite SDK

To use Appwrite in our Refine app, we'll need to find our project ID. Find your project's ID in the Settings page.

Project settings screen
Project settings screen

Navigate to src/utility/appwriteClient.ts and add your API credentials.

TypeScript
import { Account, Appwrite, Storage } from "@refinedev/appwrite";
const APPWRITE_URL = '<YOUR_API_ENDPOINT>'; // Replace with your Appwrite API Endpoint
const APPWRITE_PROJECT = "<PROJECT_ID>"; // Replace with your project ID
const appwriteClient = new Appwrite();
appwriteClient.setEndpoint(APPWRITE_URL).setProject(APPWRITE_PROJECT);
const account = new Account(appwriteClient);
const storage = new Storage(appwriteClient);
export { account, appwriteClient, storage };

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.