kavachOS
Authentication

Figma

Sign in with Figma using OAuth 2.0.

Setup

Get credentials

Go to figma.com/developers and click Create a new app. Set the redirect URI to:

https://your-app.com/api/kavach/auth/oauth/callback/figma

Configure

lib/kavach.ts
import { createKavach } from 'kavachos';
import { oauth } from 'kavachos/auth';
import { figmaProvider } from 'kavachos/auth';

const kavach = await createKavach({
  database: { provider: 'sqlite', url: 'kavach.db' },
  plugins: [
    oauth({
      providers: [
        figmaProvider(
          process.env.FIGMA_CLIENT_ID!,
          process.env.FIGMA_CLIENT_SECRET!,
        ),
      ],
    }),
  ],
});
FIGMA_CLIENT_ID=...
FIGMA_CLIENT_SECRET=...

Scopes

Default scopes: file_read

ScopeWhat it unlocks
file_readRead files, projects, and user info

Endpoints

MethodPathDescription
GET/auth/oauth/authorize/figmaRedirect to Figma
GET/auth/oauth/callback/figmaHandle callback

On this page