FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

embedded-universal-api-example/examples at main · mindcloud-inc/embedded-universal-api-example · GitHub

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Examples by stack

The same three steps as the running app, in the language you actually use. Every file here is what the See Code Implementation page renders when you pick a stack — the page reads these files, so they never drift.

Step What it does Where it runs
1. Identify the customer Create the MindCloud end user once, mint a short-lived token per session Backend
2. Let the customer connect Load the SDK with that token and open the MindCloud-hosted dialog Frontend
3. Use the connection Call any of the 3,400+ apps by installationId Backend

Backend

Stack Step 1 Step 3
Node.js / Express node/identify-the-customer.js node/use-the-connection.js
Python / FastAPI python/identify_the_customer.py python/use_the_connection.py
Go go/identify_the_customer.go go/use_the_connection.go
Ruby / Rails ruby/identify_the_customer.rb ruby/use_the_connection.rb
PHP / Laravel php/IdentifyTheCustomer.php php/UseTheConnection.php
curl curl/identify-the-customer.sh curl/use-the-connection.sh

Frontend

Stack Step 2
React react/useMindCloud.js
Vue vue/useMindCloud.js
Plain JavaScript vanilla/integrations.html

Next.js is not listed here because this repo is the Next.js example — the running app's own files (app/api/*, lib/*) are what the code page shows for that stack.

Three things that trip people up

  1. POST /v1/users does not deduplicate. Create the end user once and store data.userId on your own user row.
  2. Action slugs are the docs-style kebab form: the catalog's listChannels is addressed as list-channels, sendChannelMessage as send-channel-message.
  3. sdk.getIntegrations() with no arguments returns the SDK's cached list. Pass any options object (e.g. { includeWorkflows: true }) to force a refetch.
  4. Use the SDK's onClose callback, not onAuthenticationComplete: only onClose fires when the dialog is dismissed with the X or the backdrop.
  5. Resolve the installationId from your own session, never from the request body — it is a handle to that customer's connected account. Note you have to store the mapping yourself: connections carry no endUserId, so /v2/connections cannot be filtered by end user.

Per-app action docs live at https://mindcloud.co/docs/universal/rest/<appSlug>/latest.

Full contracts and error codes: ../LLM.md.


Back | FazBrowse Home | New Git URL