Skip to content

feat(adapter-teams): add getUser() support#404

Merged
bensabic merged 2 commits intovercel:feat/get-userfrom
heyitsaamir:feat/teams-get-user
Apr 29, 2026
Merged

feat(adapter-teams): add getUser() support#404
bensabic merged 2 commits intovercel:feat/get-userfrom
heyitsaamir:feat/teams-get-user

Conversation

@heyitsaamir
Copy link
Copy Markdown
Contributor

@heyitsaamir heyitsaamir commented Apr 20, 2026

Summary

  • Implements getUser() for the Teams adapter, stacked on feat: add chat.getUser() for cross-platform user lookups #391
  • Uses Microsoft Graph API (GET /users/{user-id}) with cached aadObjectId
  • Caches activity.from.aadObjectId during webhook handling for later lookups
  • Requires User.Read.All application permission
  • Minor fix to bump up teams.apps package, and user User-Agent for telemetry instead of X-UserAgent

Test plan

image

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 20, 2026

@heyitsaamir is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@heyitsaamir heyitsaamir marked this pull request as ready for review April 21, 2026 05:34
@heyitsaamir heyitsaamir force-pushed the feat/teams-get-user branch 2 times, most recently from 5b87f5c to 06ed0f0 Compare April 23, 2026 22:54
- Cache aadObjectId from activity.from during webhook handling
- Implement getUser() using Graph GET /users/{user-id} endpoint
- Requires User.Read.All application permission
- Returns null gracefully when user hasn't interacted or Graph call fails
@bensabic bensabic force-pushed the feat/teams-get-user branch from 6bb65af to 0fa25f5 Compare April 29, 2026 00:20
@bensabic bensabic merged commit 9be0fa3 into vercel:feat/get-user Apr 29, 2026
2 of 4 checks passed
dancer pushed a commit that referenced this pull request Apr 29, 2026
* feat(adapter-teams): add getUser() via Microsoft Graph API

- Cache aadObjectId from activity.from during webhook handling
- Implement getUser() using Graph GET /users/{user-id} endpoint
- Requires User.Read.All application permission
- Returns null gracefully when user hasn't interacted or Graph call fails

* docs: add getUser() section to Teams adapter README
dancer added a commit that referenced this pull request Apr 29, 2026
* feat: add chat.getUser() for cross-platform user lookups

Add UserInfo type and optional getUser() method to the Adapter interface.
Implement on Slack (extends existing lookupUser with email/avatar),
Discord, Google Chat, GitHub, Linear, and Telegram adapters.

Add "Who Am I" button to the example app demonstrating the feature.
Update docs with getUser API reference and usage examples.

* fix(chat): improve getUser across slack and gchat adapters

- slack: return null from lookupUser on failure instead of fallback
  object, removing the isBot === undefined sentinel in getUser
- slack: use image_192 instead of image_72 for better avatar quality
- gchat: cache avatarUrl from webhook sender payload
- gchat: return avatarUrl in getUser response
- gchat: fix tests to use current cache format with isBot field
- docs: document null return, fix example to use message.author

* chore: fix lint

* docs(chat): include Microsoft Teams in getUser supported adapters list

* feat(adapter-teams): add getUser() support (#404)

* feat(adapter-teams): add getUser() via Microsoft Graph API

- Cache aadObjectId from activity.from during webhook handling
- Implement getUser() using Graph GET /users/{user-id} endpoint
- Requires User.Read.All application permission
- Returns null gracefully when user hasn't interacted or Graph call fails

* docs: add getUser() section to Teams adapter README

* chore: apply ultracite formatting to adapter-teams getUser

* fix(chat): cover all 7 adapters in getUser inference and document per-platform constraints

---------

Co-authored-by: dancer <josh@afterima.ge>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants