Skip to main content
Each customer in your application maps to an isolated Social media studio end user. Social connections and posts are scoped to that end user, while your partner key is scoped to the entire developer project.

Upsert an end user

Use an immutable identifier from your own database as externalId. Calling upsert again with the same value updates the customer and re-enables it if it was previously disabled.
Store endUser.id with your customer record. SDK methods use this Social media studio ID, not externalId.
To stop a customer from using the embedded platform:
Disabling deactivates the customer’s isolated workspace. A later upsert with the same externalId reactivates it.

Create a connect session

Connect sessions expire after 10 minutes and can be used only for the specified end user. Redirect the customer to the returned connectUrl:
The returnUrl origin must exactly match an origin registered on your partner project, including scheme, hostname, and port. Paths and query parameters may vary. Credentials embedded in a return URL are rejected.

Handle completion

After the hosted flow reaches a terminal state, the customer sees a return button. The destination receives these query parameters: Treat browser parameters as a notification, not proof of success. Confirm the result from your backend using the connect-session ID you created:
The hosted page also sends a postMessage to its opener when used in a popup:

List and disconnect accounts

Always pass the end-user ID that owns the connection. Social media studio rejects attempts to read or disconnect a connection belonging to a different customer.

Session states

Create a new session after failed or expired; terminal sessions cannot be restarted.