Authentication
Linear
Sign in with Linear using OAuth 2.0.
Setup
Get credentials
Go to linear.app/settings/api and click Create new OAuth application. Add your redirect URI:
https://your-app.com/api/kavach/auth/oauth/callback/linearConfigure
import { createKavach } from 'kavachos';
import { oauth } from 'kavachos/auth';
const kavach = await createKavach({
database: { provider: 'sqlite', url: 'kavach.db' },
plugins: [
oauth({
providers: [
{
id: 'linear',
clientId: process.env.LINEAR_CLIENT_ID!,
clientSecret: process.env.LINEAR_CLIENT_SECRET!,
},
],
}),
],
});LINEAR_CLIENT_ID=...
LINEAR_CLIENT_SECRET=...Scopes
Default scopes: read
| Scope | What it unlocks |
|---|---|
read | Read access to the user's data |
write | Write access to issues, comments, etc. |
issues:create | Create issues |
app:assignIssues | Assign issues to the app |
Linear uses UUIDs as user identifiers. The user's email is always returned and is verified.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /auth/oauth/authorize/linear | Redirect to Linear |
| GET | /auth/oauth/callback/linear | Handle callback |