Snap API Documentation

website·Indexed 18 days ago

https://docs.snap.com/

Technical documentation and API references for Snap developer tools, including Lens Studio (Classes, Components, Assets, and Scripting), Camera Kit SDK for AR content integration, Snap Kit for Unity, and Snapchat for Web Social Plugins such as the Share Sheet API.

Tokens
481.1K
Snippets
1.1K
Records
4.1K
Agent score
99%

What's inside Snap API

  1. Overview of AI Enabled Custom Components

    AI Enabled Custom Components (or 'Blocks') are standard Lens Studio Custom Components augmented with an AiMetadata.md file. This metadata allows Lens Studio AI's Creator Mode to understand how to add the component to a scene, modify its parameters, call its APIs, and respond to its events based on user prompts.
  2. Overview of Leaderboard Core

    LeaderboardCore is a lightweight, logic-only component used to power real-time score tracking in Snapchat Lenses. It provides the necessary APIs for initialization, score submission, and user rank queries, but does not provide built-in visuals; developers must implement their own custom game logic and UI.
  3. Overview of Push-to-Device for Lens Preview

    Push-to-Device allows Lenses in development to be previewed directly within a Camera Kit integration. It mirrors the traditional 'Send to Snapchat' workflow from Lens Studio. This feature requires Login Kit integration and is intended for development and testing only; it should not be shipped to end-users.
  4. Overview of Lens Studio

    Lens Studio is a development environment used to craft immersive augmented reality (AR) experiences. It provides a robust set of features for creators to build AR Lenses, including specialized APIs for lens scripting and editor plugins.
  5. Overview of the Music Video sample project

    The Music Video sample project in Lens Studio allows developers to time visual effects based on audio timestamps. It includes helper scripts to trigger scripts, update text, and call Behaviors. While it showcases the use of Licensed Music assets, it is compatible with any Audio Track File.
  6. Overview of Bitmoji features in Lens Studio

    Bitmoji Avatar allows developers to integrate a Snapchat user's (or their friends' or an AI assistant's) Bitmoji into a Lens. Available formats and features include:

    • 3D Bitmoji: Fully-rigged 3D models supporting animations and Mixamo integration.
    • Bitmoji Selfies and Stickers: 2D Bitmoji textures displayed as images.
    • Bitmoji Head: A reactive head that mimics the Snapchatter's facial expressions.
    • Bitmoji Face Animator: Adds facial animations and predefined states (e.g., Happy, Angry).
    • Bitmoji Attachment: Allows attaching props to avatars for interactivity.
    • Bitmoji Suite: A plugin for customizing clothes, creating animations, and generating props.
    • Character Controller: Used for creating 3D Bitmoji-based games.
  7. Overview of Connected Lens features for Spectacles and Camera Kit

    Connected Lenses allow Snapchatters to share a single AR space both locally (colocated) and remotely. This feature is exclusively available for Spectacles and Camera Kit. The Connected Template provides several core systems to accelerate development:

    • Invitation Flow: Manages how users join a shared session.
    • Relay System: Facilitates passing messages between participants.
    • Avatar System: Enables co-presence for remote participants.
    • Syncing Examples: Demonstrates how to synchronize object instantiation and transform manipulation across the network.
  8. Overview of Lens Studio for AR Development

    Lens Studio is a free AR development platform by Snap AR used to create selfie Lenses, shoppable try-on experiences, and other AR applications. It integrates with Snapchat, Spectacles, and mobile/web applications via Camera Kit. The platform includes Sample Projects, Face Templates, an AI Assistant (Q&A Chat), and a GenAI Suite featuring Immersive Machine Learning effects and 3D Body Morph.
  9. Overview of World Mesh and Depth Texture capabilities

    World Mesh provides a real-time 3D reconstruction of the physical environment, allowing AR experiences to respond to and be occluded by real-world surfaces.

    Key capabilities include:

    • World Mesh: An automatically generated 3D mesh of the real world used for occlusion and environmental interaction.
    • Hit Test Results: Ability to perform ray casting to determine the position and normal of a hit point on the mesh. On LiDAR-enabled devices, hit tests also provide semantic classification (e.g., wall, floor, ceiling, table, seat, window, door).
    • Depth Texture: A texture representing the depth of the world from the camera's perspective, useful for effects like depth of field.

    Requirement: The Camera object must contain a Device Tracking component with the World option enabled to accurately map the mesh to the real world.

  10. Overview of Face Expression tracking

    The Face Expression effect tracks 51 distinct facial expressions corresponding to emotions or muscle movements. Each expression provides a 'weight' parameter (typically between 0.0 and 1.0) indicating the strength of the expression. For example, EyeBlinkLeft increases in weight as the user blinks. Because facial structures vary, weights may not always reach absolute 0.0 or 1.0.
  11. Overview of World Depth Texture in Lens Studio

    The World Depth Texture allows developers to capture depth data for all visible surfaces in the real world. This enables the creation of AR experiences where virtual objects can realistically interact with and be occluded by the user's physical environment.
  12. Overview of Snapchat for Web Social Plugins

    Snapchat for Web Social Plugins allow developers to integrate Snapchat features directly into a website or application. Supported integrations include sharing content from a site to Snapchat and embedding Snapchat Lenses, Spotlights, Stories, or Profiles into web pages.