Developer docs

Official SDKs for TypeScript and PHP. Same contract, same routes, same permissions Gurb's own app checks.

TypeScript1.7.0PHP1.7

Overview

The Gurb SDK gives you a whole community over an API: posts, events, blogs, albums, groups, tasks, comments, likes, members and permissions — plus embedding the community itself inside your site.

The packages

They are split along the one line that matters: who is allowed to hold your secret key.

PackageRuns inHolds the keyUse it for
@gurb/serverNode 20+yesReading and writing your community, members, minting embed sessions
@gurb/embedBrowserneverRendering the community, or one section, inside your page
@gurb/api-typesbothShared types
ts
import { createGurbClient } from '@gurb/server'

const gurb = createGurbClient({ apiKey: process.env.GURB_API_KEY! })

const community = await gurb.community.get()
const feed = await gurb.tweets.list({ limit: 20 })

await gurb.tweets.create({ content: 'أهلاً بالجميع 👋' })

A key is pinned to one community

There is no communityId argument anywhere. The key carries the community, so a leaked key damages exactly one and can never be pointed at another.

The two SDKs are identical on the wire

TypeScript and PHP are written against one route contract and track each other version for version. They differ only in call-site shape, which is language idiom rather than contract.

php
$gurb = new Gurb\GurbClient(getenv('GURB_API_KEY'));

$community = $gurb->community->get();
$feed      = $gurb->tweets->list(limit: 20);

$gurb->tweets->create('أهلاً بالجميع 👋');