Skip to content

Component Showcase

Visual demonstration of all Supabase-quality UI components available in Varity docs.


Enhanced code blocks with copy buttons and file names.

lib/varity.ts
import { db } from '@varity-labs/sdk'

// Query data from a collection
const result = await db.collection('documents').get()

if (!result.success) {
console.error('Error:', result.error)
} else {
console.log('Documents:', result.data)
}

Four semantic types for different message priorities.

💡 Pro tip

Use environment variables for all API keys and sensitive configuration. Never commit credentials to Git.

ℹ️ Note

The default RPC endpoint is https://rpc-varity-testnet.t.conduit.xyz. You can override this in your Varity SDK configuration.

⚠️ Breaking change in v2.0

The SDK now uses a modular pattern. Use db for database operations and standalone functions for credentials instead of a client instance.

🚨 Security warning

Never expose your service role key in client-side code. This key has full access to your Varity project and should only be used in server environments.

💡 Advanced usage

You can pass additional options to customize the database:

import { Database } from '@varity-labs/sdk'
const customDb = new Database({
proxyUrl: 'https://your-proxy.example.com',
appToken: 'your-app-token',
})

See the SDK Overview for all options.


Multi-language code examples with keyboard navigation.


Perfect for quickstart guides with 5-6 numbered steps.

1

Create a Varity account

Go to developer.store.varity.so and sign up for free. No credit card required.

2

Install the Varity CLI

Install varitykit globally using pip.

Terminal window
pip install varitykit
3

Initialize your project

Run the init command to set up your project structure and configuration.

Terminal window
varitykit init my-app
cd my-app
4

Deploy to Varity

Deploy your app with a single command. Your app will be live in under 2 minutes.

Terminal window
varitykit app deploy
5

View your live app

Varity will output your deployment URL. Your app is now live on the Varity platform!

✓ Deployed: https://my-app.varity.app
✓ Build time: 1m 23s
✓ See pricing at varity.so

Feature showcases and navigation grids.


Collapsible content for advanced/optional sections.

What is Varity L3?

Varity L3 is the infrastructure layer that powers Varity applications. It provides:

  • Free operations for users (sponsored by developers)
  • Sub-second finality for fast responses
  • Full compatibility with existing development tools
  • Native USDC as the payment token

Chain ID: 33529

RPC: https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz

Advanced: How smart accounts work

Varity uses ERC-4337 Account Abstraction for smart accounts. When you create an account:

  1. Factory creates a new smart account at a deterministic address
  2. Session keys enable free operations for specific actions
  3. Paymaster (0x579772Bfa5Ec1e8f33B81F304ffDbC55135db154) sponsors usage fees
  4. User operations are bundled and executed efficiently

Smart accounts are created automatically when a user signs in. Varity handles all the complexity behind the scenes — developers just use the usePrivy hook from @varity-labs/ui-kit.

Learn more about smart accounts

Example: Complete authentication flow

Here’s a complete example showing login, user state, and logout:

import { PrivyStack, PrivyLoginButton, usePrivy } from '@varity-labs/ui-kit'
// Set up auth provider
function App() {
return (
<PrivyStack appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID}>
<AuthExample />
</PrivyStack>
)
}
// Use the auth hook for state
function AuthExample() {
const { ready, authenticated, user, logout } = usePrivy()
if (!ready) return <p>Loading...</p>
if (!authenticated) {
return <PrivyLoginButton />
}
return (
<div>
<p>Logged in as: {user?.email?.address}</p>
<button onClick={logout}>Log out</button>
</div>
)
}

NewBetaComing SoonAdvancedDeprecated
Varity L3: Operational
Maintenance scheduled: Jan 31, 2026
Deployment failed
Service unavailable

db.collection(name).get()async

Query all documents in a collection. Returns a CollectionResponse with success status and data.


Here’s how components work together in a real docs page:

💡 Tip

This example shows the recommended pattern for quickstart pages.

Advanced: Custom database configuration

For production deployments, you may want to customize the database configuration:

import { Database } from '@varity-labs/sdk'
const customDb = new Database({
proxyUrl: 'https://your-proxy.example.com',
appToken: 'your-app-token',
})
// Use the custom database instance
const users = customDb.collection('users')
const result = await users.get({ limit: 10 })