myBridge Connect
Lets other products (myBridge Learning, Bambiala, …) use myBridge, the way apps use Google:
- Sign in with myBridge (like "Sign in with Google"): myBridge is an OAuth 2 / OpenID Connect provider
(
django-oauth-toolkit). - myBridge Meet for partner apps (like an app creating Google Meet links): a partner app creates myBridge Meet meetings for a person who connected their account, gets join links, and is told by webhook when a meeting starts, ends or is cancelled.
Getting access
For now the myBridge team registers each app. Send us its name, its exact return (redirect) addresses, whether it
runs on a server or in a browser or phone, the permissions it needs and, for Meet, its webhook address. You get a
client id and secret, and a webhook secret. Try everything on staging first: https://api.bybk.org, with test
accounts. Production is https://api.mybridge.me.
The interactive API reference is at /developers/api/ on the same addresses.
SDKs
Two small SDKs wrap everything below (sign-in with PKCE, token refresh, userinfo / me, the Meet API, the account
check and webhook verification). Both are in the myBridge API repository under sdks/ until they are published:
| Language | Package | For |
|---|---|---|
| JavaScript / TypeScript | @mybridge/connect (sdks/js) |
Node servers (18+), and PKCE / sign-in links in browsers |
| Python | mybridge-connect (sdks/python), sync and async |
FastAPI, Django or any Python server (3.10+) |
Each has a README with a quick start. Keep the client secret and tokens on your server; the browser only needs the sign-in link.
Sign in with myBridge (for the partner app)
Discovery: GET https://<api>/oauth/.well-known/openid-configuration
- Send the browser to
https://<api>/oauth/authorize?response_type=code&client_id=…&redirect_uri=…&scope=openid profile email&state=…&nonce=…. PKCE (code_challenge,code_challenge_method=S256) is required for public apps (in a browser or on a phone) and optional for confidential ones, which prove themselves with their secret. Every/oauth/…address works with or without the trailing slash. - myBridge forwards to its consent page. The person signs in there if they need to, then allows or declines.
- The partner receives
redirect_uri?code=…&state=…, or?error=access_denied&state=…if the person declined. - Exchange the code on the server:
POST /oauth/token/withgrant_type=authorization_code,code,redirect_uri,client_id,client_secret,code_verifier. The answer hasaccess_token(1 hour),refresh_token(90 days, replaced on every use) andid_token. The client may authenticate with HTTP Basic instead of the body. GET /oauth/userinfo/withAuthorization: Bearer <access_token>.
| Scope | Claims |
|---|---|
openid |
sub: the person's myBridge uuid. Never changes, and is never the database id. |
profile |
name, given_name, family_name, preferred_username (profile address), picture, profile (link), age_13_or_over (true, false, or null when unknown; the birth date itself is never sent) |
email |
email, email_verified |
phone |
phone_number (E.164), phone_number_verified |
meet |
no claims; allows the Meet API below |
- Revoke a token with
POST /oauth/revoke(or/oauth/revoke_token/). GET /api/v1/connect/me(scopeprofileoremail) answers{id, name, email}, for apps that don't read OpenID's userinfo.POST /api/v1/connect/accounts/checkwith{"email": …}or{"phone": "+…"}and the app's client id and secret (HTTP Basic) answers{"exists": true|false}. Only for apps allowed to check accounts; 120 a minute per app. Learning uses it at sign-up to offer a link, never to merge.
myBridge Meet for partner apps (scope meet)
Every call takes Authorization: Bearer <access_token>. The meeting belongs to the person who connected (for
example a teacher): it appears in their myBridge calendar and they host it. A partner app only sees the meetings
it created itself. Errors answer {"error": "<code>", "message": "<text>"} (invalid_request, invalid_token,
insufficient_scope, not_found, conflict, rate_limited).
| Call | What it does |
|---|---|
GET /api/v1/connect/meet/health |
Checks the API, the database and the meeting server. No token needed. Answers 200, or 503 when one of them is down. |
POST /api/v1/connect/meet/meetings |
Creates a meeting. Body: title, start_at (ISO 8601; null or left out = now), duration_minutes (default 60), optional external_ref (your own id), description, waiting_room (default off), timezone (IANA, default UTC). |
GET /api/v1/connect/meet/meetings[?external_ref=] |
Lists this app's meetings for this person. |
GET / PATCH / DELETE /api/v1/connect/meet/meetings/{id} |
Reads, changes or cancels a meeting. Cancelling tells everyone on it; the meeting then reads as cancelled. |
POST /api/v1/connect/meet/meetings/{id}/invites |
Body: {"guests": [{"email", "name"}], "notify": false}. Gives each person a personal join link. |
A meeting answers {id, title, start_at, end_at, duration_minutes, status, host_url, guest_url, external_ref,
invites, members, …}. status is scheduled, live, ended or cancelled.
host_url: the host joins signed in to myBridge.guest_url: with the waiting room off (the default), anyone with it joins with just a name, no account and no waiting. With it on, the host lets them in.invites: personal links for people without an account; they skip the waiting room even when it is on. Show them in your app, or setnotify: trueto have myBridge email them.members: people with a myBridge account; they join with the meeting link, signed in.
Limit: 50 invites per meeting.
Webhooks
Events are POSTed as JSON to the app's webhook URL: {"id", "type", "created_at", "data"}.
| Type | data |
|---|---|
meeting.started, meeting.ended, meeting.cancelled |
the meeting, as the Meet API answers it |
connection.revoked |
{"user_id", "revoked_at"}: the person disconnected the app on myBridge |
Header MyBridge-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" with the webhook secret>.
Check it, and refuse times more than 5 minutes off. A 5xx or 429 answer is retried with backoff (up to 6 times).