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/figmaConfigure
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
| Scope | What it unlocks |
|---|---|
file_read | Read files, projects, and user info |
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /auth/oauth/authorize/figma | Redirect to Figma |
| GET | /auth/oauth/callback/figma | Handle callback |