> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# App user connectors

> Let each app user connect their own third-party account

<div className="dev-docs-banner">
  <div className="dev-docs-banner-content">
    <div className="dev-docs-banner-title">
      You're viewing developer documentation
    </div>

    <div className="dev-docs-banner-text">
      This documentation is for developers working with the Base44 developer
      platform. For information about connectors in the app editor, see{" "}
      <a href="/Integrations/Connectors">Using Connectors</a>.
    </div>
  </div>
</div>

App user connectors let each signed-in app user connect their own third-party account. Each app user gets their own OAuth token. Use this when actions need to happen as the individual app user, like sending email from their Gmail account, posting to their personal LinkedIn, or reading their own Google Calendar events.

Unlike shared connectors, where one account is shared across all app users, app user connectors store a separate OAuth token per user. The OAuth flow runs under your registered OAuth application, so app users see your app's name on the provider's consent screen.

<Note>App user connectors require a Builder plan or higher.</Note>

## Set up

Before app users can connect their accounts, register your OAuth app credentials in your workspace. This requires workspace admin access. You also need a client ID and client secret from the external service.

Register the connector from your Workspace Settings. See [Setting up connectors for app users](/Integrations/user-connectors) for step-by-step instructions.

After you register the connector, the workspace assigns it an ID. Use that ID to connect and disconnect app users in your frontend code and retrieve their tokens in your backend functions.

## Connect and disconnect in your frontend

Use `base44.connectors` in your frontend code to start and end the OAuth flow for each app user.

To connect an app user, call [`connectAppUser`](/developers/references/sdk/docs/interfaces/connectors#connectappuser) with the connector ID. It returns a redirect URL. Navigate the app user to that URL to start the OAuth flow.

```typescript theme={null}
const redirectUrl = await base44.connectors.connectAppUser("YOUR_CONNECTOR_ID");
window.location.href = redirectUrl;
```

After the app user completes the flow, their token is stored [and your backend functions can retrieve it]().

***

To disconnect an app user, call [`disconnectAppUser`](/developers/references/sdk/docs/interfaces/connectors#disconnectappuser) with the connector ID. It removes the stored token for the currently signed-in app user.

```typescript theme={null}
await base44.connectors.disconnectAppUser("YOUR_CONNECTOR_ID");
```

## Retrieve the token in a backend function

Use [`createClientFromRequest()`](/developers/references/sdk/docs/functions/createClientFromRequest) to create the SDK client in your backend function. It reads the app user's identity from the incoming request automatically, so the SDK knows which user's token to return.

Then call [`getCurrentAppUserConnection()`](/developers/references/sdk/docs/interfaces/connectors#getcurrentappuserconnection) with the connector ID to retrieve the token for the app user making the current request.

```typescript theme={null}
import { createClientFromRequest } from "@base44/sdk";

export default async function handler(req: Request) {
  const base44 = createClientFromRequest(req);

  const { accessToken } =
    await base44.asServiceRole.connectors.getCurrentAppUserConnection(
      "YOUR_CONNECTOR_ID",
    );

  const response = await fetch(
    "https://www.googleapis.com/calendar/v3/calendars/primary/events",
    {
      headers: { Authorization: `Bearer ${accessToken}` },
    },
  );

  const events = await response.json();
  return Response.json(events);
}
```

## See also

* [Connectors overview](/developers/backend/resources/connectors)
* [Shared connectors](/developers/backend/resources/connectors/shared-connectors)
* [Setting up connectors for app users](/Integrations/user-connectors)
* [SDK connectors reference](/developers/references/sdk/docs/interfaces/connectors#getcurrentappuserconnection)
* [createClientFromRequest](/developers/references/sdk/docs/functions/createClientFromRequest)
* [Backend Functions](/developers/backend/resources/backend-functions/overview)
