RPC Services
Complete service index for the Pug Connect RPC API. Generate typed clients from proto with buf generate.
Proto source: cotton/proto
Public
No authentication required.
| Service | Methods | Description |
|---|---|---|
AuthService | SignIn, SignInWithMagicLink, SignInWithOAuth, SignUp, RefreshToken | User authentication |
Dashboard (JWT + x-project-id)
Browser sessions for growth managers.
| Service | Methods | Description |
|---|---|---|
OrgsService | Create, Get, List, Update, InviteMember, ListMembers, RemoveMember | Organization management |
ProjectsService | Create, Get, List, Update, CreateApiKey, ListApiKeys, RevokeApiKey | Project CRUD and API keys |
DashboardsService | List, Get, Create, Update, Upsert, Delete | Dashboard and tile management |
OrgEmailProvidersService | Get, Upsert, Delete, SendTest | Email provider configuration |
CustomersService | List, Get, Update | Customer (dashboard user) records |
SDK (API key + x-project-id)
Client-side write access. Safe for browsers and mobile apps.
| Service | Methods | Description |
|---|---|---|
EventsService | BatchCreate | Ingest event batches |
ProfilesSDKService | Identify, Alias | Link anonymous profiles, merge IDs |
Shared (API key or JWT + x-project-id)
Server-side or trusted integrations.
| Service | Methods | Description |
|---|---|---|
InsightsService | Query | Run analytics queries |
ActivityService | List | Recent activity feeds |
ProfilesService | Get, List, Delete | Profile reads and soft-delete |
Endpoint format
Connect RPC endpoints follow the pattern:
POST https://api.pug.sh/{package}.{version}.{Service}/{Method}Examples:
POST /events.v1.EventsService/BatchCreate
POST /insights.v1.InsightsService/Query
POST /profiles.v1.ProfilesSDKService/Identify
POST /dashboards.v1.DashboardsService/UpsertGenerate clients
git clone git@github.com:fivebitsio/cotton.git
cd cotton
buf generateSupported languages: TypeScript, Go, Python, Java, and others via Buf .
TypeScript example
npm install @connectrpc/connect @connectrpc/connect-web @bufbuild/protobufimport { createClient } from '@connectrpc/connect'
import { createConnectTransport } from '@connectrpc/connect-web'
import { EventsService } from './gen/events/v1/events_connect'
const transport = createConnectTransport({ baseUrl: 'https://api.pug.sh' })
const client = createClient(EventsService, transport)See Authentication for auth interceptors.
Service documentation
| Page | Service |
|---|---|
| Events API | EventsService |
| Profiles API | ProfilesSDKService, ProfilesService |
| Insights API | InsightsService |
| Dashboards API | DashboardsService |
| Orgs & Projects | OrgsService, ProjectsService |
This page will be auto-generated from proto in a future docs pipeline. Method signatures may change — refer to proto source for the authoritative schema.
Further reading
Last updated on