1.0.0 • Published 2 years ago

streamapi2 v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Stream Video/Audio API

Test mode (Not recommended for production usage)

  import React from "react";
  import { Stream } from "streamapi";
  export default () => {
    return <Stream
      title={"Join room"}
      chat={true}
      testMode={true}
      data={{
         name: "<username>",
         room:  "<unique room id>", 
         type: "producer" or "consumer",
         record: true or false,
      }}
      accessKey="<your access key>"
      onEnded={() => {
        // User clicked on the close button, the Stream component can now be unmounted and
        // logic to collect post session stats can kick in
      }}
      theme={{
	primary: "#f3f3fc",
	contrast: "#6d6af8"
      }}
    />
  }

Production script

  import React from "react";
  import { Stream } from "streamapi";
  export default () => {
    return <Stream
      chat={true}
      token="<token>"
      accessKey="<your access key>"
      onEnded={() => {
      	// User clicked on the close button, the Stream component can now be unmounted and 
	// logic to collect post session stats can kick in
      }}
    />
}

How to create a production token

https://app.gitbook.com/@streamai/s/stream/

How to get your accessKey

https://getstream.in