Skip to content
Back to skills

Hamster Integrations

ASecurity

External integration patterns including Airweave context connectors, OAuth flows, and third-party service connections. Use when implementing new integrations or working with context connections.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
developmenttypescriptnextjsapidatabasefrontend

Works with

  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add gethamster/skills --skill hamster-integrations --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hamster Integrations?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Hamster Integrations
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gethamster-hamster-integrations/badge)](https://www.skillsdirectory.com/skills/gethamster-hamster-integrations)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: hamster-integrations
description: "External integration patterns including Airweave context connectors, OAuth flows, and third-party service connections. Use when implementing new integrations or working with context connections."
version: "1.1.0"
---

# Hamster Integrations

## Quick Reference

| Task | Pattern | Reference |
| --- | --- | --- |
| Add new OAuth integration | Create service + DTO + callback + dialog | [oauth-patterns.md](references/oauth-patterns.md) |
| Get/create Airweave collection | `getOrCreateCollection(accountId)` | [airweave-collections.md](references/airweave-collections.md) |
| Create source connection | Use `access_token` format | [airweave-collections.md](references/airweave-collections.md) |
| Find integration specs | Check OAuth type and scopes | [integration-catalog.md](references/integration-catalog.md) |

## When to Apply

- Adding new context connector integrations
- Working with Airweave collections
- Implementing OAuth flows
- Troubleshooting integration authentication

## Architecture Overview

```
┌─────────────────────────────────────────────────────────────────┐
│                    Integration Architecture                      │
├─────────────────────────────────────────────────────────────────┤
│ Frontend           →  OAuth Redirect  →  Third-Party Provider   │
│ (Connect Dialog)      (with SITE_URL)                           │
│                                                                 │
│ OAuth Callback     →  Exchange Code   →  Token Response         │
│ (Next.js API)         (NestJS)                                  │
│                                                                 │
│ NestJS Service     →  Store Token     →  Vault                  │
│                    →  Create Source   →  Airweave               │
│                                                                 │
│ Airweave           →  Sync Data       →  Team Collection        │
└─────────────────────────────────────────────────────────────────┘
```

## Critical Rules

1. **Use same SITE_URL** - Frontend and callback must use same URL to avoid `bad_redirect_uri`
2. **access_token format** - Airweave expects `{ access_token: token }`, not nested credentials
3. **Lazy collection creation** - Collections created on first context connection
4. **Self-healing collections** - Verify "active" collections actually exist in Airweave

## Key Patterns

### Source Connection Authentication

```typescript
// CORRECT - matches Airweave's oauth_token authentication type
authentication: {
  access_token: tokenResponse.access_token,
}

// WRONG - nested credentials not recognized
authentication: {
  credentials: { bot_token: tokenResponse.access_token }
}
```

### OAuth Types

| Type | Description | Refresh Needed |
| --- | --- | --- |
| `access_only` | Tokens don't expire | No |
| `with_refresh` | Standard refresh tokens | Yes |
| `with_rotating_refresh` | New refresh token each refresh | Yes |
| `oauth1` | Legacy OAuth 1.0a | N/A |

### Collection States

| Status | Meaning |
| --- | --- |
| `initializing` | DB record created, Airweave collection pending |
| `active` | Collection exists in both DB and Airweave |
| `failed` | Collection creation failed (will retry on next attempt) |

## Adding a New Integration

1. Create OAuth service: `apps/ai/src/modules/context-connections/[provider]-oauth.service.ts`
2. Add DTO: `apps/ai/src/modules/context-connections/dto/create-[provider]-oauth-connection.dto.ts`
3. Add schema: `packages/shared/src/context-connections/schemas.ts`
4. Create callback route: `apps/web/app/api/oauth/[provider]/callback/route.ts`
5. Create dialog: `apps/web/app/home/[account]/context-settings/_components/connect-[provider]-dialog.tsx`
6. Add to `AVAILABLE_SERVICES` in constants
7. Add i18n translations

## References

- [oauth-patterns.md](references/oauth-patterns.md) - OAuth flow implementation
- [airweave-collections.md](references/airweave-collections.md) - Collection management
- [integration-catalog.md](references/integration-catalog.md) - All 40+ integrations with specs

## Key Files

| File | Purpose |
| --- | --- |
| `apps/ai/src/modules/context-connections/` | OAuth services and handlers |
| `apps/ai/src/modules/context-connections/collection-creation.helper.ts` | Collection helper |
| `apps/web/app/api/oauth/` | OAuth callback routes |
| `apps/web/app/home/[account]/context-settings/` | Connection UI |
| `public.airweave_collections` | Collection database table |

Files in this skill

  • SKILL.md4.8 KB
  • references/airweave-collections.md6.1 KB
  • references/integration-catalog.md7 KB
  • references/oauth-patterns.md8.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…