User & Friends
The current user and friends, user context and activity, and leaderboards.
Commonly used
UserContextSystemProvides information about the user such as display name, birthday, and current weather.LeaderboardModuleEnables usage of Leaderboard API within a Lens.SnapchatUserA User backed by a Snapchat account.UserRepresents a user of the current runtime.
Guides
User Context OverviewThe User Context System allows you to get information about the current user, such as their display name, birthday, current weather, their bitmoji, friends, and more.Friends ComponentsThe Friends API allows interactive user information based on a Snapchatter’s friends to be pulled into the Lens.Friends CarouselThe Friends Carousel is a custom UI component designed to allow users to pick a friend by either scrolling through a list or tapping on a list element.Bitmoji 2DYou can add a 2D Bitmoji texture representing the user as well as their friends that you can display as an image anywhere in your Lens.OverviewBitmoji Avatar lets you pull a Snapchat user’s Bitmoji (or their friends’, or an AI assistant’s) into a Lens so the experience feels personalized and on-brand.Bitmoji 3DYou can add a 3D Bitmoji avatar representing the user as well as their friends.
All APIs in this topic
Reference assets and other modules with a script input and require modules with require('LensStudio:<name>').
Components, assets, and modules
| API | Description |
|---|---|
| LeaderboardModule | Enables usage of Leaderboard API within a Lens. |
| UserActivityModule SPECS | Exposes the user's current mode of action (e.g. stationary, walking) and posture (e.g. standing, sitting) to Lens developers. |
Objects and data
| API | Description |
|---|---|
| Leaderboard | A leaderboard which can contain scores and information about participating users. |
| SafeUser | Represents a user of the current runtime with only non-sensitive information (Bitmoji info). |
| SnapchatFriendUserInfo | Details about friendship between the active user and another user. |
| SnapchatUser | A User backed by a Snapchat account. |
| SnapData | |
| SpecsUser SPECS | A User backed by a Specs (Spectacles) account, which may or may not have a Snapchat account linked. |
| User | Represents a user of the current runtime. |
| UserBirthday | A user's birth month and day, returned by User#birthday. |
| UserContextSystem | Provides information about the user such as display name, birthday, and current weather. |
Enums
| API | Description |
|---|---|
| AccountType | The kind of account backing a User. |
| WeatherCondition | Types of weather returned by UserContextSystem's callback. |
| Zodiac |