Meet Media API: TypeScript reference client quickstart

This page explains how to set up and run a sample using the TypeScript reference client implementation. To learn about the C++ client instead, see the C++ reference client quickstart.

Prerequisites

To run this quickstart, you need the following prerequisites:

Generate OAuth tokens

To connect to the Meet Media API, your app must use OAuth to generate access tokens. To learn more about accessing Google APIs with OAuth, see Using OAuth 2.0 to Access Google APIs.

When building a web app, you can generate OAuth tokens using the implicit grant flow. This TypeScript sample uses this flow to generate OAuth tokens.

Run the sample

  1. Create an OAuth client

  2. Within the web/samples directory, build the sample:

    $ yarn install --frozen-lockfile
    $ webpack
    
  3. Follow the Authenticate for using the gcloud CLI guide to sign in and select your Google Cloud project.

  4. Deploy your server to Google App Engine.

    $ gcloud app deploy app.yaml
    
  5. Navigate to your endpoint:

    $ gcloud app browse
    
  6. Follow the Create access credentials guide to create OAuth 2.0 credentials with these scopes:

    • https://www.googleapis.com/auth/meetings.conference.media.readonly
    • https://www.googleapis.com/auth/meetings.space.readonly

    Add your deployed app's URL to Authorized JavaScript Origins and Authorized Redirect URIs.

  7. Copy the client ID and paste it into the deployed web page.

  8. Tap the sign-in button and follow the prompts. If you run into an error, note that it might take a few minutes for the redirect URIs to propagate.

  9. Create and join a meeting. Copy the meeting code, pasting it into the "meeting code" input on the page.

  10. Select the number of video streams and enable audio.

  11. Click Create Client, then Join Meeting.

  12. Observe the video and audio streams.