Search code examples
reactjsstreamshareagora.io

How can we generate Stream sharable link in agora?


how can we make a sharable link of stream in agora so that we can share it and other people can join it. Agora provides any kind of feature so that we can generate a stream link???


Solution

  • You can embed these parameters as you would embed any other query parameter.

    Example URL: https://example.com/?channel=cha123&appid=183432424242

    In JavaScript:

    let params = (new URL(document.location)).searchParams;
    let channel = params.get('name'); // is the string "cha123".
    let appid = params.get('appid'); // is the string "183432424242"
    

    Reference: https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams