https://linen.dev logo
How to get connected account's data?
# 🖥│support-forum
t
How do I get the connected accounts details, like what identifier (email/username) was used to authenticate the toolkit? This extra but useful info can be provided in this
connectedAccount
object when we do this:
Copy code
const connectedAccount = await composio.connectedAccounts.get(
  input.connectionId
);
I'm currently mapping the GET_PROFILE_TOOL for each toolkit and using it to fetch connected account details, this adds extra complexity and not every toolkit has a tool to fetch profile data I'm letting users connect multiple accounts to each toolkit and display the connected accounts in toolkit details
Copy code
const connectionRequest =
  await composio.connectedAccounts.initiate(
    input.userId,
    input.authConfigId,
    {
      callbackUrl: input.callbackUrl,
      allowMultiple: true,
    }
);
I only need some info like the identifier (email/username) and the avatar of the connected account, is there a better way to do this?
u
Hey @tminusdev, yes,
connectedAccounts.get()
will give you the auth data not exactly the surface level data. We do not map user's profile data and it can only be accessed if any tool(endpoint) is available for the specific toolkit.
t
Okay Got it.